> For the complete documentation index, see [llms.txt](https://imgo.gitbook.io/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://imgo.gitbook.io/en/api/tobase64.md).

# ToBase64

Return a Base64 encoded string in PNG format for the image.

## Parameters

None

## Return Values

`string`

## Examples

```go
package main

import (
    "github.com/fishtailstudio/imgo"
)

func main() {
    base64Img := imgo.Load("gopher.png").ToBase64()
}
```

In the above example, the `base64Img`string is `data:image/png;base64,......`
