URL Encoder / Decoder
Tip: Ctrl+Enter to process
Enter your text and press
Encode or Decode
Encoded Output
URL Encoding Guide
URL encoding (percent-encoding) replaces unsafe or reserved ASCII characters with a % followed by two hex digits. This ensures URLs remain valid across every browser, server, and system.
Encoding a query string with special characters:
hello world & name=João
hello%20world%20%26%20name%3DJo%C3%A3o
Component Most Common
Uses encodeURIComponent(). Encodes everything except unreserved chars: A–Z a–z 0–9 - _ . ! ~ * ' ( ).
Use for individual query parameter values.
Full URI
Uses encodeURI(). Preserves characters valid in a complete URL structure.
Use when encoding a whole URL — keeps slashes and query markers intact.
Form
Like Component, but spaces become + instead of %20.
Use for HTML form POST bodies and legacy query strings.
| Character | Percent-Encoded | Form (+) Encoded | Description |
|---|---|---|---|
(space) | %20 | + | Space character |
! | %21 | %21 | Exclamation mark |
# | %23 | %23 | Hash / fragment identifier |
& | %26 | %26 | Ampersand — param separator |
+ | %2B | %2B | Plus sign |
/ | %2F | %2F | Forward slash — path separator |
= | %3D | %3D | Equals sign — key/value separator |
? | %3F | %3F | Question mark — query start |
@ | %40 | %40 | At sign |
[ | %5B | %5B | Opening bracket |
] | %5D | %5D | Closing bracket |
Query Parameters
Always encode values appended to URLs as query params. Unencoded &, =, and # break URL parsing.
Form Submissions
Use Form mode to manually prepare application/x-www-form-urlencoded payloads or debug form POST bodies.
API Calls & Debugging
Decode received URLs to inspect parameters, or encode values before inserting into fetch requests to prevent injection errors.
Q1: What is the difference between %20 and + for spaces?
%20 is the standard percent-encoding for a space (RFC 3986). The + sign represents a space only in application/x-www-form-urlencoded data — in a URL path, + is a literal plus sign.
Q2: Is URL encoding the same as Base64?
No. URL encoding replaces unsafe characters with %xx hex sequences. Base64 converts binary data to a 64-character alphabet. Use URL encoding for URLs; Base64 for binary data in text contexts.
Q3: When should I use encodeURI vs encodeURIComponent?
Use encodeURI for a complete URL — it preserves structural characters like /, ?, and #. Use encodeURIComponent for individual parameter values — it also encodes those structural characters.
Q4: Is URL decoding safe on untrusted input?
Decoding itself is safe, but always validate decoded values before use. Watch for double-encoded input (e.g., %2520) which can bypass security filters — decode exactly once then sanitise.