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 — Base64, URL, HTML, Binary, Hex, and Morse

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 switches between six encoding formats — Base64, URL, HTML entities, Binary, Hex, and Morse code — and encodes or decodes whatever's in the input box.

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.

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

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.

Binary: Converts each character to its 8-bit binary representation, space-separated. Mostly useful for teaching or learning how text maps to raw bits — not something you'd use in day-to-day web work.

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

Morse code: Converts letters and numbers to dots and dashes per the international Morse standard. More of a curiosity than a work tool these days, but it's the same format that's been used for over a century of telegraphy.

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.

Teaching how text becomes bits: The Binary tab is a quick way to show someone (a student, a curious colleague) what "everything is 1s and 0s" actually looks like for a real sentence.

Tips

Use Swap to chain conversions — decode a Base64 string, then re-encode the result in Hex, without retyping anything. Choose the format based on where the encoded string is actually going: HTML entities for markup, URL encoding for query parameters, Base64 for API payloads and binary data.

For HTML entity encoding, only the characters 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 you type or paste. Binary file encoding — turning an actual file, like an image, into Base64 — is handled by the dedicated Base64 tool on this site, which supports file uploads. None of the six formats here are encryption; Morse code and Binary in particular are fully reversible with no key involved, so don't use them for anything that needs to stay private.

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