URL Encoder & Decoder
Encode and decode URLs instantly. Convert special characters to percent-encoded format or decode them back.
What is URL Encoding?
URL encoding (also called percent-encoding) converts characters that are not allowed in a URL into a safe representation using a percent sign followed by two hexadecimal digits — for example, a space becomes %20 and an ampersand becomes %26. The URL specification (RFC 3986) defines a set of "unreserved" characters that can appear as-is (letters, digits, - . _ ~); everything else must be encoded before being included in a URL.
Common Use Cases
- Encode query parameter values that contain spaces, special characters, or non-ASCII text
- Build URLs programmatically from user-supplied input without breaking link structure
- Decode percent-encoded URLs from browser address bars or server logs
- Safely pass JSON or structured data as a URL parameter
- Fix "invalid URL" errors caused by unencoded characters in API requests
How It Works
This tool uses JavaScript's encodeURIComponent() for component encoding (encodes everything except unreserved characters) and encodeURI()for full URL encoding (preserves structural characters like ://?=&). Decoding uses decodeURIComponent(). All processing happens in your browser — nothing is sent to a server.
Frequently Asked Questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI is designed for full URLs — it preserves characters like :, /, ?, and # that have structural meaning. encodeURIComponent encodes those characters too, making it suitable for individual query parameter values.
Why is a space sometimes encoded as + instead of %20?
The + encoding for spaces is part of the application/x-www-form-urlencoded format used by HTML forms — it is not standard percent-encoding. Modern APIs typically prefer %20; always check what the target system expects.
Do I need to encode the entire URL or just parts of it?
Only encode the dynamic parts — query parameter names and values, path segments that contain special characters. Encoding the whole URL would break the structural characters (://, /, ?, &) that define URL structure.
Related Tools
Base64 Encoder
Encode and decode strings using Base64 encoding.
JWT Decoder
Decode and inspect JSON Web Tokens securely in your browser.
JSON Formatter
Format, validate, and minify JSON data instantly.
Unix Timestamp
Convert Unix timestamps to human-readable dates and back instantly.
Hash Generator
Generate MD5, SHA-1, SHA-256, and SHA-512 hashes instantly.
JSON ↔ YAML
Convert between JSON and YAML instantly with real-time validation.
Regex Tester
Test and debug regular expressions with live match highlighting.
UUID Generator
Generate UUID v4 values instantly, with bulk generation and validation.
JWT Generator
Build and sign JSON Web Tokens with a custom payload and secret.
Text Diff
Compare two blocks of text and highlight additions, deletions, and unchanged lines.
Case Converter
Convert text to camelCase, snake_case, UPPERCASE, kebab-case, and more.
Cron Parser
Parse cron expressions into plain English and see the next scheduled run times.
SQL Formatter
Format and minify SQL queries with dialect support for MySQL, PostgreSQL, SQLite, and more.
CSV ↔ JSON
Convert CSV to JSON or JSON to CSV with support for custom delimiters and quoted fields.
Number Base Converter
Convert between decimal, hexadecimal, octal, and binary number bases.
Color Converter
Convert colours between HEX, RGB, HSL, HSV, and CMYK formats.
What is URL encoding? URL encoding (percent-encoding) replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits, ensuring URLs are transmitted correctly over the internet.
Uses encodeURIComponent / decodeURIComponent — all conversions happen locally in your browser.