URL Encode / Decode
Encode text into URL-safe form (%XX) or decode an encoded URL back to text.
Category: Converters
When to use?
Use it when a query string must include non-ASCII characters or special characters, or to turn a percent-encoded URL back into readable text.
How to use
- Encode: enter text to convert to URL-safe form (%XX).
- Decode: enter an encoded URL to convert back to text.
Input Explanation
Enter text to encode, or %-encoded URL text to decode.
Calculation Basis
It converts non-ASCII characters, spaces, and special characters to %XX form via encodeURIComponent. Spaces are encoded as %20.
Usage Examples
- Encode characters in a URL - Convert special characters to encoded form for a query string.
- Build API parameters - Convert parameter values with special characters into URL-safe strings.
- Decode an encoded URL - Turn a percent-encoded URL back into readable text.
Examples
- "hello world" → "hello%20world"
- "café" → "caf%C3%A9"
Cautions
- Malformed source data can cause parsing errors or broken output.
- A mismatched encoding standard (UTF-8) or complex nested data may break or drop the structure.
Guides
Why URL encoding
URLs allow only letters, numbers, and some symbols directly. Non-ASCII characters, spaces, and special characters must be encoded as %xx for the URL to work.
Encode vs. decode
A space encodes as + or %20. If you see encoded characters in an API parameter or shared link, this tool reveals the original text.
FAQ
Why is URL encoding needed?
To safely transmit characters not allowed in URLs (non-ASCII, spaces, special characters) by converting them to %XX form.
What is the difference between encodeURI and encodeURIComponent?
encodeURIComponent encodes more characters, suitable for query parameter values.
When does a decoding error occur?
When a % is not a complete valid sequence or an invalid UTF-8 sequence is present.
How are spaces encoded?
Spaces are encoded as %20.
Related Tools
- Query String ↔ JSON Converter - Convert URL query strings and JSON objects bidirectionally.
- HTML Escape / Unescape - Convert HTML special characters to entities, and restore entity strings back to characters.
- Base64 Converter - Encode text to Base64 or decode a Base64 string back to text.
- UTM Parameter Builder - Add UTM parameters to a URL to build a marketing campaign tracking link.
- Color Code Converter - Convert HEX, RGB, RGBA, HSL, HSLA color codes to each other and preview the color.
- File Size Converter - Convert Byte, KB, MB, GB, TB file size units on a 1000 or 1024 basis.