TITravis Interactive

Guide

What is Base64?

Base64 is an encoding scheme that converts binary data into a text representation. It uses 64 characters A Z, a z, 0 9, plus and slash to encode any sequence of bytes. This makes it safe to move data through systems that only handle text, such as JSON, HTML or configuration files.

Base64 does not compress or encrypt data. It only transforms it into a different format. Anyone who has the encoded string can easily decode it back to the original content.

Common uses for Base64

How Base64 encoding works

Base64 takes groups of three bytes and splits them into four 6 bit values. Each 6 bit value maps to one of the 64 characters in the alphabet. Padding with equal signs is used when the input length is not a multiple of three bytes.

Text:   "TI"
Bytes:  54 49
Base64: VEk=

Security considerations

Because Base64 is reversible, it should never be treated as a security control. Encoding secrets with Base64 does not protect them. Use proper encryption and secret management when dealing with sensitive data.

Encoding and decoding Base64

Most programming languages provide built in functions to encode and decode Base64. Browsers expose btoa and atob in JavaScript for this purpose.

If you want to work with Base64 quickly in your browser without writing code, use the Base64 Encoder and Decoder on Travis Interactive. It lets you convert between plain text and Base64 with all processing done locally in your browser.