Go Base64 Encoding

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!


  • func (enc *base64.Encoding) Encode(dst, src []byte)
  • func (enc *base64.Encoding) Decode(dst, src []byte) (n int, err error)
  • func (enc *base64.Encoding) EncodeToString(src []byte) string
  • func (enc *base64.Encoding) DecodeString(s string) ([]byte, error)


The encoding/base64 package contains several built in encoders. Most of the examples in this document will use base64.StdEncoding, but any encoder (URLEncoding, RawStdEncodign, your own custom encoder, etc.) may be substituted.

Got any Go Question?