FREE
Loading…
URL encode or decode strings. Convert special characters to percent-encoded format and back.
Encode / Decode URL
Processing…
FREE
Loading…
Encode/Decode URL is a free online tool that percent-encodes special characters for safe use in URLs or decodes percent-encoded strings back to readable text. Essential for web developers working with query strings, API parameters, or URIs — this tool specifically implements encodeURIComponent()/decodeURIComponent() behavior, which is the correct choice for encoding individual values rather than whole URLs.
A URL can only reliably contain a limited set of characters — letters, digits, and a handful of punctuation marks defined by the URI specification (RFC 3986). Everything else — spaces, ampersands, question marks appearing inside a value, non-ASCII letters, emoji — has to be represented using percent-encoding: a % followed by two hexadecimal digits representing that character's byte value. A space becomes %20, an ampersand becomes %26, and an accented character like é becomes %C3%A9 once it's broken into its UTF-8 byte representation. Skip this step and the browser, server, or intermediate proxy is left guessing where one URL component ends and another begins — a bare & inside a query parameter value looks identical to the separator between two different parameters, which is exactly the class of bug this tool exists to prevent.
JavaScript actually provides two related but distinctly different encoding functions, and picking the wrong one is a common source of broken links. encodeURI() is meant for encoding an entire URL and deliberately leaves structural characters like /, ?, #, and : untouched, since those are meaningful delimiters in a full URL and shouldn't be escaped. encodeURIComponent() — what this tool uses — is meant for encoding a single component, such as one query parameter's value, and encodes everything except unreserved characters (letters, digits, and - _ . ~), including characters like &, =, and / that would otherwise be misread as URL structure if they appeared inside a value.
A related and equally important distinction is between percent-encoding, which this tool implements, and HTML entity encoding (turning & into &), which is a completely separate escaping mechanism used to prevent characters from being misinterpreted as HTML markup rather than URL structure. Confusing the two is a frequent source of double-encoding bugs, where a value gets percent-encoded and then HTML-entity-encoded (or vice versa) and comes out wrong on the other end.
Everything runs using the browser's native, spec-compliant encodeURIComponent() and decodeURIComponent() functions — no custom regex substitution that could miss an edge case — and no text you enter is ever sent to a server.
Encoding passes your input directly to JavaScript's built-in encodeURIComponent(), which converts every character outside its small unreserved set (A-Z, a-z, 0-9, and - _ . ~) into UTF-8 bytes and represents each byte as a %XX hexadecimal escape — so a single non-ASCII character can expand into two or three percent-encoded triplets depending on how many UTF-8 bytes it requires. Decoding passes a percent-encoded string to decodeURIComponent(), which reverses the exact same mapping, reconstructing the original UTF-8 byte sequence from each %XX triplet and decoding it back to readable text. If the input to decode contains a malformed sequence — a stray % not followed by two valid hex digits, or a truncated multi-byte UTF-8 sequence — decodeURIComponent() throws a URIError, which this tool catches and reports as a specific, readable error rather than returning corrupted or partial output.
Paste your URL or string
Enter the URL or text string you need to encode or decode in the input field.
Encode or decode
Click "Encode URL" to percent-encode special characters, or "Decode URL" to convert encoded sequences back to readable text.
Copy the result
Copy the output for use in web development, API calls, or browser address bars.
Query String Parameters
Encode user-supplied search terms or filter values before appending them as URL query parameters.
API Request Construction
Percent-encode parameter values when building API request URLs programmatically to prevent injection issues.
Internationalized URLs
Encode non-ASCII characters like accented letters or CJK characters so they are safe to use in URLs.
Debugging Encoded URLs
Decode obfuscated or percent-encoded URLs from logs or redirects to read the original destination.
Mailto Link Parameters
Encode subject and body text for mailto: links to ensure special characters render correctly in email clients.
Redirect URL Encoding
Encode return_url or redirect parameters that contain slashes and question marks to keep the parent URL valid.
encodeURIComponent Accuracy
Uses JavaScript's encodeURIComponent which encodes all unsafe characters correctly for query parameter values.
Decode Mode Included
Decode any percent-encoded string back to readable text with a single button, covering both encode and decode workflows.
Malformed Sequence Detection
Shows a clear error when decoding an invalid percent-encoded sequence rather than returning corrupted output.
Unicode Handling
Correctly encodes multi-byte Unicode characters to their full percent-encoded form per the URI specification.
Instant Results
Encoding and decoding run synchronously in the browser so output appears immediately without any delay.
No Upload Required
All processing is client-side so you can safely encode sensitive query parameters and tokens offline.
Also Try
Also Known As
Binary To Decimal
Convert between binary, decimal, hex and octal number systems
Color Converter
Convert colors between HEX, RGB, and HSL formats
Convert Binary
Convert binary numbers to text and text to binary
Convert Timestamp
Convert Unix epoch timestamp to standard date format and back
Count Words
Count words, characters, sentences and paragraphs in text
Convert Datetime
Convert datetime between different formats and timezones
Trusted Worldwide
iLoveDocsTools is used by students, professionals, and businesses across the United States, Canada, United Kingdom, Australia, India, and more than 100 other countries. All tools are browser-based and process files privately — your files never leave your device. Free to use, with Pro plans for unlimited access.
All processing happens directly in your browser. Your documents are never sent to any server — complete privacy guaranteed for users in the USA, Canada, UK, and worldwide.
Every tool on iLoveDocsTools is free to use. Need more? Upgrade to Pro for unlimited usage, priority access, and no daily limits. Trusted by students, freelancers, and teams across North America and Europe.
Whether you are on a Mac, Windows PC, iPhone, or Android in New York, Toronto, London, or Sydney — our tools work instantly in any modern browser.
Looking for free PDF tools in the USA? Free document converters in Canada? Online PDF editors in the UK or Australia? iLoveDocsTools offers 70+ free tools — merge PDF, split PDF, compress PDF, convert Word to PDF, Excel to PDF, JPG to PDF, and many more — all free, all instant, all private. No watermarks. No file size limits. Just free tools that work.