Free String Encoder & Decoder

Encode and decode strings instantly. Supports Base64, URL encoding, HTML entities, Unicode escape, hexadecimal, and binary. Switch between encode and decode with one click. Free, no signup, works entirely in your browser.

Plain Text
0 chars
Base64 Encoded
0 chars
ย 
Ctrl/โŒ˜ + K focuses input ยท Ctrl/โŒ˜ + L toggles theme

How to Encode and Decode Strings Online

1. Choose encode or decode. Click the Encode button to convert plain text into an encoded format. Click Decode to convert encoded text back to readable text.

2. Select an encoding type. Choose from Base64, URL Encode, URL Encode (full), HTML Entities, Unicode Escape, Hex, or Binary. Each format serves a different purpose.

3. Paste or type your text. The output updates instantly as you type. Click Copy to copy the result to your clipboard.

4. Use the swap button to flip between encode and decode. The current output becomes the new input, making it easy to verify round-trip encoding.

Supported Encoding Formats

Base64

Converts text to a safe ASCII representation using 64 characters. Used for embedding images, email attachments, JWT tokens, and data URIs.

URL Encode (Component)

Encodes all special characters for use in URL query parameters. Spaces become %20, ampersands become %26. Use this for individual parameter values.

URL Encode (Full URI)

Encodes a complete URL while preserving structure characters like :, /, ?, and #. Use this when encoding an entire URL string.

HTML Entities

Escapes characters that have special meaning in HTML: <, >, &, quotes. Essential for displaying code in web pages and preventing XSS.

Unicode Escape

Converts non-ASCII characters to \uXXXX sequences. Used in JavaScript, JSON, and systems that only support ASCII.

Hexadecimal

Shows the hex byte values of each character in UTF-8. Useful for debugging, viewing raw data, and working with binary protocols.

Binary (UTF-8)

Shows the binary representation of each byte. Useful for understanding character encoding at the bit level.

When to Use String Encoding

Web development: Encode user input for safe inclusion in URLs, HTML, and JavaScript. Prevent XSS vulnerabilities by encoding HTML entities before rendering user content.

API development: Base64 encode credentials for HTTP Basic Auth headers. URL encode query parameters before sending API requests. Decode API responses that return encoded data.

Data transfer: Base64 encode binary data (images, files) for embedding in JSON, XML, or email. Decode Base64 strings received from APIs and webhooks.

Debugging: Decode URL-encoded strings from browser address bars and server logs. View hex and binary representations to diagnose character encoding issues.

Security: Decode suspicious Base64 or URL-encoded strings to inspect their contents. Encode payloads for safe transmission in security testing.

Frequently Asked Questions

What is Base64 encoding?

Base64 converts binary data into a text format using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It is commonly used to embed images in HTML and CSS, send binary data in JSON and XML, encode email attachments (MIME), and pass data in URLs and cookies.

What is URL encoding?

URL encoding (percent-encoding) replaces unsafe characters in URLs with a percent sign followed by their hex value. For example, a space becomes %20 and an ampersand becomes %26. This ensures URLs are valid and can be parsed correctly by browsers and servers.

What is the difference between URL Encode and URL Encode (full)?

URL Encode (encodeURIComponent) encodes all special characters including slashes, colons, and question marks. URL Encode full (encodeURI) preserves URL structure characters like ://?#@, only encoding characters that are not valid anywhere in a URL. Use the first for query parameter values, the second for complete URLs.

What are HTML entities?

HTML entities replace characters that have special meaning in HTML. For example, < becomes &lt; and & becomes &amp;. This prevents browsers from interpreting your text as HTML code, which is essential for displaying code snippets and preventing XSS attacks.

What is Unicode escape?

Unicode escape represents non-ASCII characters as \uXXXX sequences where XXXX is the hexadecimal code point. This is used in JavaScript strings, JSON, and other formats that need to represent international characters in pure ASCII text.

When would I need hex or binary encoding?

Hex encoding is useful for debugging, viewing raw byte values, working with color codes, and cryptographic hashes. Binary encoding shows the actual bits and is useful for understanding how text is stored at the lowest level. Both are common in programming and security work.

Does this tool handle Unicode and emoji?

Yes. All encoding methods support full Unicode including emoji, CJK characters, Arabic, Cyrillic, and other scripts. The tool uses UTF-8 encoding internally, which is the standard for web content.

Is my text sent to a server?

No. All encoding and decoding happens in your browser using JavaScript. Your text never leaves your device.

More Free Text Tools

Encode strings here, then use our other tools to convert case, count words, clean text, or remove duplicates.