URL Encoder / Decoder
Percent-encode text for safe use in URLs, decode percent-encoded strings, or parse a full URL to inspect its components and query parameters.
URL Components
Query Parameters
| Parameter | Value |
|---|
How it works
URLs may only contain a specific set of ASCII characters. Any character outside that set must be percent-encoded: replaced with a % followed by its two-digit hexadecimal byte value. For example, a space becomes %20.
This tool uses encodeURIComponent and decodeURIComponent for component encoding, and the browser's URL API for full URL parsing.
Common uses
- Query string values — encode user input before appending to a URL:
?q=hello+world - Redirect URLs — encode the destination URL when passing it as a query parameter
- API debugging — decode a URL from a log or curl command to see the original parameters
- OAuth callbacks — decode the
redirect_uriandstateparameters from OAuth flows
🔒 Privacy
All URL encoding and parsing happens in your browser. Your input is never sent to any server.
Edge cases and limits
- Space: %20 vs + —
encodeURIComponentuses%20. Form-encoded bodies use+for spaces. The tool uses%20. - Invalid percent sequences — a
%not followed by two hex digits (e.g.%ZZ) is invalid and will show an error in decode mode. - Repeated parameters —
?a=1&a=2is valid and shows both values in the parse table. - Missing protocol — the URL parser requires a protocol (
https://). Without it, the URL is treated as a relative path. - Unicode — multi-byte characters are UTF-8 encoded before percent-encoding.
FAQ
What is the difference between URL encoding and Base64?
URL encoding escapes characters that are unsafe in URL contexts using %XX hex sequences. Base64 encodes arbitrary binary data as alphanumeric characters. They solve different problems: URL encoding preserves readability for text, Base64 is for binary-to-text conversion.
Should I encode the full URL or just the parameter values?
Encode individual values before inserting them into a URL (use encode component mode). Encoding a complete URL encodes the protocol and slashes, breaking it. Most programming languages provide separate functions for each: encodeURI vs encodeURIComponent in JavaScript.