Text Encoding

Convert between Text, Base64, Base32, ASCII85, Hex, Binary, Octal and Decimal bytes, URL encoding and HTML entities in any direction, and calculate MD5 and SHA hashes.

From
To

Usage

Choose the format of your input and the format you want to convert it to, then type or paste into the left box. The result updates in real-time and can be copied with the button in the right box.

When you paste something, the tool guesses its format and offers to switch the From format to it. The swap button exchanges both formats and moves the result into the input, which is handy to check that a conversion round-trips.

How it works

Every format is just a different way of writing down bytes, so each conversion decodes the input into bytes first and then encodes those bytes into the output format:

  • Text is encoded as UTF-8, so characters like ä, € or emoji work in every direction.
  • Base64 input may contain line breaks, use the URL-safe alphabet (- and _) and omit the = padding.
  • Base32 uses the RFC 4648 alphabet (A-Z, 2-7). Input may be lowercase and omit the padding.
  • ASCII85 uses the Adobe variant, where z stands for four zero bytes. The <~ and ~> delimiters are optional.
  • Hex, Binary, Octal bytes and Decimal bytes write one group per byte, separated by spaces. Input may also be separated by ,, ; or :. Hex, binary and octal input may omit leading zeros, and unseparated runs of digits are split into bytes. Hex may use 0x prefixes.
  • URL encoding escapes everything except A-Z, a-z, 0-9 and -_.~ as %XX. When decoding, + is read as a space, as in form data.
  • HTML entities escapes &, <, >, " and ', and writes every non-ASCII character as a named entity (© becomes &copy;) if HTML 4 has one, or else as a numeric reference (👋 becomes &#x1F44B;), so the result is plain ASCII. Decoding understands all named (&copy;) and numeric (&#169;, &#xA9;) entities.

Converting between formats other than Text works on the raw bytes, so it also works for data that isn't text, like images. Converting such data to Text (or HTML entities) is not possible and shows an error instead.

Hashes

Open the Hashes section below the result to see the MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes of either:

  • Decoded data (default): the bytes the input decodes to, so they are the same no matter which format the data is written in. The section shows what that data is, e.g. both &copy; and &copy decode to ©, since browsers accept some HTML entities without the trailing ;.
  • Input as typed: the input exactly as typed, encoded as UTF-8.

MD5 and SHA-1 are no longer secure, but are still common as checksums.

Privacy

This tool runs entirely in your browser and does not send any data to a server.

Something not working as expected? Let me know.