Base64 Converter

Base64 converter for both directions: convert text to Base64 and Base64 to text in one screen. This Base64 translator keeps an encoder and a Base64 to text converter side by side, so you can check a round trip without switching pages. It answers how to convert to Base64 and how to convert back, with URL-safe output, padding, line wrap, and charset options.

Encode

Input · text
0 chars
Line wrap
EOL
Charset

Input 0 B · Output 0 B

Decode

Input · Base64
0 chars
Line wrap
EOL
Charset

Input 0 B · Output 0 B

A base64 converter keeps both directions of the transformation on one screen and runs them in your browser: type text on the left panel to encode it, paste Base64 on the right panel to decode it, and use Swap to move a result across. The text never leaves the device.

Use it when you need to check that an encoded value really decodes to what you expect, when two teammates disagree about padding or URL-safe characters, or when an API response has to be compared against the request that produced it. One screen, two panels and a live byte counter make the two-way workflow easier to audit than two separate tools. The counter also shows whether a difference comes from the text or from the options.

How to use

  1. Choose a direction. The Encode tab takes text and returns Base64. The Decode tab takes Base64 and returns text. Both panels are mounted at once, so switching tabs never clears what you typed.
  2. Match the options. URL-safe, No padding and Line wrap apply to the encode side; URL-safe and Charset apply to the decode side. Set them before you compare two outputs, because a padded value and an unpadded one look different even when the bytes are identical.
  3. Swap and verify. Swap drops the current output into the other panel’s input and switches tabs, so a base64 converter round trip takes two clicks. Copy either result, or download encoded.txt and decoded.txt.

Round trips, options and false differences

The interesting cases are not the simple ones. These notes cover what the converter guarantees, where a round trip can look broken, and which option is usually responsible.

A base64 translator without the ambiguity

Calling the page a base64 translator is convenient, but nothing is being translated: the bytes are regrouped, not interpreted. The same input always produces the same output, which is why a value can be checked by hand. The stats line under each panel reports input bytes, output bytes and the percentage change, so a 300-byte sentence should show about 400 output characters rather than a number that drifts between runs. Each panel also keeps its value after a tab switch, so both strings stay visible in one place.

Convert text to base64 and back in one step

A round trip is the quickest test of an unfamiliar value. Type a<TAB>b and the encode panel returns YQli; Swap, and the decode panel returns the tab exactly as it was. Newlines behave the same way, which helps when a config value contains indentation. Trailing spaces are equally literal: a value ending in two spaces decodes to two spaces, and some editors trim them without asking. If the decoded text comes back with an extra blank line, the original probably ended with \r\n and the encoder read it as two characters.

Picking options for the base64 to text converter

hello? encodes to aGVsbG8/ in standard Base64 and aGVsbG8_ in URL-safe mode, so the two strings are not interchangeable. On the decode side, a URL-safe value without the switch fails on _ or -, and a padded value pasted with the switches off still decodes because padding is optional. When a base64 converter result looks wrong, compare the option row before assuming the payload is damaged.

FAQ

How to convert to base64 and back?

Type in either panel of this base64 converter and the other side updates as you type. If the text returns unchanged, the round trip is clean. Both panels stay on screen, so nothing is hidden.

Is this the same as a Base64 encoder?

It contains both directions. A dedicated encoder page is simpler when you only need to encode, while this base64 converter adds the opposite panel, a Swap button and a second set of charset options for decoding.

Why do two Base64 strings for the same text differ?

Padding, URL-safe characters and line wrapping all change the visible string without changing the bytes. A value ending in = and one without it can decode to the same text. Compare the option row before treating a mismatch as corruption.

Does the base64 converter work offline?

Yes, once the page has loaded. Encoding and decoding are plain JavaScript, and no network request is made while you type. That also means your text is never uploaded, logged or stored on a server.

Why does decoding fail with an invalid character?

The value probably uses URL-safe characters, or it was copied with quotes and punctuation from JSON. Turn on URL-safe mode for hyphens and underscores, and paste only the string itself. The base64 converter error names the first character and its position.

For a single direction, Base64 Encode stays focused on text and offers the full charset list without a second panel. Text to Base64 is the shortest path from a sentence to a copyable string, and Base64 to Text handles the reverse when the payload is plain text. Each page uses the same alphabet and the same padding rules, so a value produced in one opens and decodes correctly in the other pages.