Upload a file
  1. base64hub
  2. Text tools

Base64 Text Tools: Encode, Decode, Charsets

Encoders and decoders for strings, plus tools that check, repair and measure Base64. Pick the tile that matches your task; each one runs entirely in your browser.

Free no sign-up, no limits Local nothing uploaded Updated Oct 27, 2026
AaBase64 encoderText to Base64, UTF-8 safe AaBase64 decoderBase64 back to readable text OKBase64 validatorCheck alphabet, length and padding FIXBase64 repairFix broken, wrapped or quoted Base64 76MIME encoderLine breaks every 76 characters AaBase64 to textReadable text from Base64, any charset AaText to Base64Any text, any charset {}Base64 to JSONDecode and pretty-print {}JSON to Base64Encode JSON payloads SIZESize calculatorEncoded length for any byte count 16UTF-16 to Base64Wide strings, LE or BE 16Base64 to UTF-16Decode UTF-16LE/BE text U8UTF-8 to Base64Emoji and any script, byte-exact U8Base64 to UTF-8Decode to Unicode text ASCASCII to Base647-bit text to Base64 ASCBase64 to ASCIIDecode to plain ASCII HTMLHTML to Base64Encode markup for data URIs and APIs HTMLBase64 to HTMLSource and sandboxed preview XMLXML to Base64Encode XML documents XMLBase64 to XMLDecode XML payloads CSVBase64 to CSVDecode CSV exports and save them

Which text tool do I need

Most text tools are the same encoder and decoder opened with a different preset, so the choice is about starting in the right place.

Your taskTool
Turn text into Base64Base64 encoder or Text to Base64
Read a Base64 stringBase64 decoder or Base64 to text
Emoji or non-Latin scripts, byte-exact UTF-8UTF-8 to Base64, Base64 to UTF-8
Windows, .NET or PowerShell wide stringsUTF-16 to Base64, Base64 to UTF-16
Plain 7-bit text onlyASCII to Base64, Base64 to ASCII
Check whether a string is valid Base64Base64 validator
Fix line breaks, quotes, missing padding or mixed alphabetsRepair Base64
Lines of 76 characters for emailMIME Base64 encoder
Base64 that holds JSON, XML, HTML or CSVBase64 to JSON, Base64 to XML, Base64 to HTML, Base64 to CSV
Encode markup for a data URI or APIHTML to Base64, XML to Base64
Predict the encoded lengthBase64 size calculator

Why the charset matters

Base64 works on bytes and knows nothing about characters. Before text can be encoded it has to be turned into bytes, and the charset decides how:

TextUTF-8Windows-1252UTF-16LE
éw6k=6Q==6QA=
GrüßeR3LDvMOfZQ==R3L832U=RwByAPwA3wBlAA==

UTF-8 is the right default for the web, JSON and most APIs. UTF-16LE is what Windows APIs and PowerShell’s -EncodedCommand expect. Legacy charsets turn up in old databases, CSV exports from desktop software and some email. When decoded text shows é instead of é, it was UTF-8 read as Windows-1252; switch the charset in the decoder and the text comes out right.

When the decoded text looks wrong

  • Random symbols and boxes: the Base64 holds binary data, such as an image, a PDF or gzip output. Use Base64 to file or, for H4sI… strings, the gzip decoder.
  • An error about invalid characters or length: the string was damaged in transit. The validator shows where, and Repair Base64 cleans the usual culprits.
  • It decodes, but to more Base64: the data was encoded twice. Decode the output again.
  • - and _ in the string: this is Base64URL, from a JWT or URL. All decoders here accept it; the Base64URL tools explain the difference.

For tokens, URLs and structured payloads like SAML or Kubernetes Secrets, see the web and token tools. For other encodings such as Base32, Base58 or hex, the base converter reads them all.

FAQ

Which tool should I use to decode a Base64 string?

Start with the Base64 decoder. If the output is unreadable, the data is probably a file or compressed, and Base64 to file detects the type. If the text has wrong accents, change the charset.

Why does the same text give different Base64 in different tools?

Base64 encodes bytes, and the text becomes bytes through a charset first. é is w6k= from UTF-8, 6Q== from Windows-1252 and 6QA= from UTF-16LE. Match the charset the other side uses.

Do I have to clean up the string before decoding?

Usually not. The decoders ignore whitespace and line breaks, strip quotes and a data:…;base64, prefix, accept URL-safe characters and restore missing padding, and the status line says what was fixed. For badly damaged input use Repair Base64.