UtilityToolsLab

© 2026 UtilityToolsLab. Built and maintained by the UtilityToolsLab Team.

Free eBooks·About·Changelog·Privacy Policy·Terms of Service·Report a bug
HomeCode & DevBase64

Related Tools

JSON FormatterUUID GeneratorJWT DecoderTimestampRegex TesterRandom JSON GeneratorAPI Load TesterJSON Diff CheckerJSON Path FinderSchema ValidatorXML FormatterHTML FormatterCSS FormatterCSS MinifierJS MinifierHTTP Status CodesASCII Table

Base64 Encoder / Decoder

Encode text or data to Base64 and decode Base64 strings back to readable text. A fast developer utility for API payloads, tokens and data URIs.

You Might Also Like

All Code & Dev

Text ↔ Base64

Encode text to Base64 or unpack a Base64 string into plain characters, with full Unicode handling and a live encoding-overhead readout.

Text ↔ Binary

Turn any text into 8-bit binary groups, then read raw bits as UTF-8 text again. Strict validation catches malformed bytes before they corrupt output.

Text ↔ Hex

Write text as uppercase hex bytes using space, comma, 0x or no separator, and parse pasted hex dumps into readable output.

JWT Decoder

Decode and inspect JSON Web Tokens. View header, payload, and signature. Detects expiry and maps all registered JWT claims.

Dropping a small icon straight into a stylesheet, stuffing a certificate into an environment variable, or moving a binary blob through a JSON field all need the same trick: express arbitrary bytes using 64 printable characters. The Base64 Encoder and Decoder does that conversion both ways with a single toggle between them.

Text goes through a UTF-8 encoder before the encoding runs, and the bytes come back through a UTF-8 decoder afterwards. That ordering is what lets a Japanese product name or a Polish surname survive the round trip, where the older technique of treating each character as a byte would corrupt anything above the Latin-1 range.

Decoding strips all whitespace before parsing, so a certificate copied with its line breaks intact needs no cleanup first. Failures are reported rather than guessed at, and no request is made in either direction.

Worked Example: A Config Value for an Environment Variable

Paste {"env":"staging","retries":3}into Plain Text Input. The Base64 Output pane returns eyJlbnYiOiJzdGFnaW5nIiwicmV0cmllcyI6M30=, which is safe to assign in a shell or a deployment manifest without worrying about quoting the braces and the colon. The single trailing =marks the last group as holding 2 bytes rather than 3: the source is 29 bytes long, and 29 leaves a remainder of 2 when divided by 3.

Tricky Inputs: Padding, Newlines and URL-Safe Variants

  • Base64 uses + and / as its last 2 characters. The URL-safe variant defined by RFC 4648 swaps them for - and _, and a string in that form will not decode here until you substitute them back.
  • Padding is expected. A blob whose trailing = characters were stripped, which some APIs do deliberately, returns Invalid Base64 string. Make sure the input is valid Base64. Restoring the padding to a multiple of 4 characters fixes it.
  • Whitespace is removed before decoding, including newlines, so PEM-style content wrapped at 64 columns decodes as it stands. The -----BEGIN and -----END lines are not whitespace and must go first.
  • Decoded binary that is not text will render as replacement characters. This decoder produces a string, so a PNG pasted in as Base64 comes out as noise rather than an image.
  • Encoding never fails on valid input, so the Encoding failed. message is effectively unreachable. If you see it, the input contains an unpaired surrogate, which usually means a broken copy and paste of an emoji.