⚡Encoder/Decoder
Encoding is the process of converting data into a specific format, and decoding is the reverse. In web development, encoding is essential for including special characters in URLs, transmitting binary data as text, and safely displaying special characters in HTML. This tool handles Base64, URL, Hex, HTML, Unicode, and JSON encoding/decoding all in one view, supporting over 34 character sets.
How to Use
- 1Enter Text
Type or paste the text you want to encode or decode in the input area at the top. Results for all formats appear simultaneously as you type.
- 2Select Character Set (Optional)
Encoding always uses UTF-8. For decoding, you can choose from various character sets such as EUC-KR, Shift_JIS, GB2312, and more.
- 3Review Results
Check results organized by category: Base64, URL, Hex, HTML Entity, Unicode escape, and more. Use the copy button next to each result to copy the value you need.
- 4Chain Conversions
Click the 'Use as input' button to set any result as the new input, enabling chained conversions.
Tips
- 💡Base64 encoding is commonly used for Data URIs to embed images directly in HTML/CSS and for email attachment handling.
- 💡URL encoding is required whenever query parameters include special characters or non-ASCII text.
- 💡HTML Entity conversion helps prevent XSS (Cross-Site Scripting) attacks by safely rendering user input.
- 💡The length info (characters, bytes, words) helps you quickly check data size constraints.
FAQ
- Q. What is the difference between Base64 and Base64URL?
- A. Base64URL replaces + with - and / with _ to make the output safe for use in URLs and HTTP headers without additional percent-encoding. It is used in JWT tokens and OAuth flows.
- Q. What happens when I Base64-encode non-ASCII text like Korean?
- A. The text is first encoded to UTF-8 bytes, then those bytes are Base64-encoded. To decode correctly, both sides must agree on using UTF-8 as the character encoding.
- Q. Why is URL encoding necessary?
- A. URLs can only safely contain a limited set of ASCII characters. Characters like spaces, Korean, and special symbols must be percent-encoded (%XX) so servers can parse them correctly.
- Q. When should I use HTML entity encoding?
- A. HTML entities prevent XSS (Cross-Site Scripting) attacks. Characters like <, >, &, and " in user-supplied content must be escaped before rendering in HTML to prevent malicious script injection.