URL Encoder / Decoder
Encode or decode URLs and query parameters for proper web transmission.
What Is URL Encoding?
URL encoding, also known as percent encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI). It converts characters that are not allowed in URLs into a format that can be safely transmitted over the internet. Our free URL encoder online runs entirely in your browser for instant, private conversions.
Why URLs Need Encoding
URLs can only contain a limited set of ASCII characters — letters, digits, and a few special
characters like - _ . ~. Characters outside this set must be
encoded to ensure proper transmission. A URL decoder reverses this process,
converting percent-encoded sequences back to their original characters.
Common Characters That Break URLs
Spaces
Spaces in URLs are encoded as %20. They should never appear raw in a URL.
Ampersand (&)
Used to separate query parameters. Must be encoded as %26 when part of parameter values.
Question Mark (?)
Reserved for the query string separator. Encoded as %3F in path segments.
Equals Sign (=)
Used for key-value pairs in query strings. Encoded as %3D in values.
Real-World Usage
- API Requests — Encode special characters in GET request query parameters to ensure correct server-side parsing.
- Query Parameters — Build URLs with properly encoded parameter names and values for web applications.
- Web Forms — Form data submitted via GET is URL-encoded automatically — decode it to inspect submissions.
- OAuth & Authentication — Encode callback URLs and state parameters in authentication flows.
- International URLs — Encode non-ASCII characters (UTF-8) for URLs containing non-Latin scripts or symbols.
How to Encode & Decode URLs
To encode a URL, paste your text into the input field and click Encode URI. The tool will convert special characters to their percent-encoded equivalents. To decode a URL, paste an encoded string and click Decode URI. You can also use Parse Query String to extract and display key-value pairs from a query string. Use the Copy button to copy the result to your clipboard.
Technical Specifications & Standards Uniform Resource Identifier (URI) percent-encoding—commonly known as URL encoding—is standardized by RFC 3986. URIs require a restricted set of characters to guarantee uniform interpretation across diverse network routers, proxy servers, operating systems, and web browsers. RFC 3986 divides the ASCII character set into two categories: "unreserved characters", which can always be transmitted without encoding (uppercase letters A–Z, lowercase letters a–z, decimal digits 0–9, hyphen '-', underscore '_', period '.', and tilde '~'), and "reserved characters", which possess specific syntactical roles within a URI (such as ':', '/', '?', '#', '[', ']', '@', '!', '$', '&', ''', '(', ')', '*', '+', ',', ';', and '='). When any reserved character is used outside its intended grammatical role, or when arbitrary non-ASCII UTF-8 bytes are included, they must be percent-encoded as a '%' followed by two hexadecimal digits representing their byte value.
How It Works in Your Browser WebUtil's URL Encoder/Decoder runs entirely within your browser's JavaScript environment using ECMAScript's native encodeURIComponent(), encodeURI(), and decodeURIComponent() primitives combined with custom RFC 3986 normalization. When you provide text or query strings, multibyte Unicode characters are first serialized into their respective UTF-8 byte sequences. Each byte is then transformed into its two-digit uppercase hexadecimal representation preceded by a percentage sign (e.g. space becomes %20, '&' becomes %26, and '€' becomes %E2%82%AC). Decoding performs the inverse process, reconstructing raw UTF-8 strings with rigorous validation against malformed surrogate sequences.
Developer Guide & Common Pitfalls Handling URL encoding properly is critical for web security and reliable API communication: - encodeURI vs encodeURIComponent: Use encodeURI() when encoding a complete URL without destroying structural delimiters like https://, /, and ?. Use encodeURIComponent() when encoding query parameter keys and values so characters like & and = do not split the query string. - Space character handling (%20 vs +): In standard RFC 3986 URI paths, a space must be encoded as %20. In HTML form submissions (application/x-www-form-urlencoded), spaces are historically encoded as '+'. Failing to distinguish between these causes broken search queries and token invalidation. - Double-encoding vulnerability: If a string that is already percent-encoded is passed through an encoder a second time, '%20' becomes '%2520'. When decoded only once by the receiving backend, the data remains corrupted. - Security against Path Traversal: Attackers frequently use percent-encoded dots and slashes (%2e%2e%2f) to attempt directory traversal attacks against web applications.
Zero-Knowledge Privacy & Security Assurance URLs and query strings frequently contain sensitive parameters: OAuth state tokens, redirect callbacks, user email addresses, API session tokens, and tracking identifiers. WebUtil ensures complete privacy by executing all encoding and decoding operations in your browser's isolated client thread. No URLs or input strings are ever transmitted, logged, or recorded on remote servers.
How to Do This in Code
Deploy Your Next Project Fast
Get $200 free credit on DigitalOcean to deploy your apps with blazing-fast infrastructure.
Related Tools
Base64 Encoder / Decoder
Encode or decode text and files to and from Base64 format instantly.
HTML Entities Encoder
Convert special characters to HTML entities and vice versa for safe web rendering.
JSON Formatter
Format, validate, and beautify your JSON data with syntax highlighting and error detection.
URL Encoder / Decoder FAQ
Why do URLs require percent-encoding?
URLs can only be safely transmitted across the internet using the standard US-ASCII character set. Special characters like spaces, &, and # have syntactic meanings in URLs and must be encoded to prevent link corruption and misinterpretation.
What is the difference between encodeURI() and encodeURIComponent()?
encodeURI() encodes a complete URL while preserving protocol and path separators (: / ? # & =). In contrast, encodeURIComponent() encodes every reserved character, making it ideal for individual query parameter values.
Why does space sometimes encode as %20 and other times as '+'?
%20 is the official RFC 3986 percent-encoding standard for URIs. The plus sign '+' is used specifically for query strings formatted under HTML form submissions (application/x-www-form-urlencoded).
Which characters must always be encoded in query parameters?
Characters with special syntactic meaning in query strings must always be encoded: & (parameter separator), = (key-value separator), # (fragment identifier), ? (query start), and spaces.
Does this tool support international characters and emoji?
Yes. WebUtil encodes international characters (such as Arabic, Chinese, Cyrillic) and emoji into their correct multi-byte UTF-8 percent-encoded representations.