String Encoder & Decoder

Encode and decode strings instantly — Base64, URL, HTML entities, Binary, Hex, and Morse code. Real-time conversion with no data sent to servers.

How to Use

1

Select an Encoding Type

Click one of the six tabs — Base64, URL, HTML, Binary, Hex, or Morse — to choose the encoding format you want to work with. Each tab changes both the encoding and decoding behavior.

2

Type or Paste Your Text

Enter any text into the Input box. The output updates in real time as you type, so you can see the encoded result immediately without pressing any button.

3

Click Encode or Decode

Use the Encode button to convert plain text to the selected format, or the Decode button to reverse the process and recover the original text from an encoded string.

4

Use Swap to Reverse

Click Swap to move the output back into the input field. This is useful when you want to chain operations — for example, decode a Base64 string and then re-encode it in Hex.

5

Copy the Result

Click Copy to send the output to your clipboard. The character count and size are shown next to the output label so you can monitor how the encoding affects the data size.

String Encoder and Decoder — Encode to Base64, HTML Entities, Unicode, and More

Text encoding issues crop up constantly in web development, data transfer, and debugging. A string that looks fine in one system becomes garbled in another, special characters break templates, or you receive data in an encoded format you need to read. This tool encodes and decodes strings across the most common encoding formats used on the web.

Encoding formats

Base64: Converts text to a string of ASCII characters using only 64 safe characters. Used for embedding binary data in text-based protocols. Decoding a Base64 string reveals the original text.

HTML entities: Converts special HTML characters (<, >, &, ") to their safe entity equivalents (&lt;, &gt;, &amp;, &quot;). Essential for displaying user-submitted content safely in HTML without breaking the page structure or enabling XSS attacks.

URL encoding (percent encoding): Encodes special characters for safe use in URLs. Spaces become %20 (or +), ampersands become %26, etc.

Unicode escape sequences: Converts characters to their Unicode code point representation — for example, the letter "A" becomes A. Used in JavaScript string literals and JSON when you need to represent non-ASCII characters in ASCII-safe format.

Hex encoding: Converts each character to its hexadecimal byte representation. Used in low-level debugging, network protocol analysis, and some cryptographic applications.

ROT13: A simple Caesar cipher that shifts each letter 13 positions forward in the alphabet. ROT13 is its own inverse — encoding and decoding use the same operation. Historically used in online forums to hide spoilers or puzzle answers.

Common use cases

XSS prevention testing: Encode a string to HTML entities to see how it will look when safely displayed in an HTML context. If user input contains <script>, encoding it to &lt;script&gt; means the browser renders it as text, not executable code.

Debugging encoded API responses: API responses sometimes contain Base64-encoded data fields. Decode them here to see the original content.

Building API requests: Some API authentication schemes require Base64-encoded credentials or request data. Encode the values here before constructing your request.

HTML email templates: When building HTML email templates, special characters in subject lines and body content need entity encoding to display correctly across all email clients.

JavaScript string debugging: Convert a string to Unicode escapes to see the exact code points, which helps debug encoding issues with multi-byte characters like Hindi text or emoji.

Tips

Choose the encoding format based on where the encoded string will be used. HTML entities for HTML templates, URL encoding for query parameters, Base64 for API payloads and binary data, Unicode escapes for JavaScript string literals.

For HTML entity encoding, remember that only the characters that are meaningful to the HTML parser need encoding (<, >, &, ", '). You don't need to encode every non-ASCII character — modern HTML5 documents in UTF-8 handle those directly.

Limitations

All encoding here works on text strings. Binary file encoding (encoding a whole file to Base64) is better handled by the dedicated Base64 tool on this site, which supports file uploads.

ROT13 is not cryptography. It's a toy cipher with zero security — it's listed here for completeness and because it's genuinely useful for hiding spoilers, not for protecting sensitive data.

Frequently Asked Questions

Base64 is a binary-to-text encoding scheme that represents binary data using only ASCII characters (A–Z, a–z, 0–9, +, /). It is commonly used to embed binary data — like images or files — inside text-based formats such as JSON, XML, email attachments (MIME), and data URIs in HTML and CSS. Base64 increases the data size by approximately 33%.

URL encoding (percent-encoding) converts special characters — spaces, &, =, ?, #, and others — into a percent sign followed by two hexadecimal digits (e.g., a space becomes %20). This ensures that values can be safely transmitted in URLs without breaking the URL structure. It is essential when passing user-supplied text as query parameters.

HTML entities are special character codes used in HTML to represent characters that would otherwise be interpreted as code. For example, < becomes &lt;, & becomes &amp;, and > becomes &gt;. Encoding user-supplied text as HTML entities prevents Cross-Site Scripting (XSS) attacks when rendering content in a web page.

Yes — Unicode characters (accented letters, Chinese, Arabic, emoji, etc.) are fully supported for Base64, URL, and HTML encoding. Binary and Hex encode the raw UTF-8 byte values of the characters. Morse code is limited to the standard Latin alphabet and digits (A–Z, 0–9); unsupported characters are shown as a question mark.

There is no hard limit enforced by this tool — all processing runs entirely in your browser with no server round-trips. Very large inputs (hundreds of kilobytes or more) may cause a brief delay, especially for Binary encoding which expands each character to an 8-character bit string. For typical text inputs, conversion is instantaneous.

Related Utility Tools