Encode and decode URLs and URL components online. Supports encodeURIComponent and encodeURI.
URL encoding, also known as percent-encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI). It replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits representing the character's byte value. This ensures that URLs are transmitted correctly over the internet without ambiguity. This tool encodes URLs and URI components and decodes percent-encoded URLs back to readable text.
Type or paste your URL on the Encode tab and the percent-encoded output appears instantly. The encoder uses JavaScript's built-in encodeURI and encodeURIComponent functions, which fully support UTF-8 multi-byte characters including emojis and international scripts. Choose between encodeURI (for full URLs, preserves URL structure) and encodeURIComponent (for individual query parameter values or path segments).
Switch to the Decode tab, paste your percent-encoded URL, and the decoded readable text appears instantly. The decoder handles all percent-encoded sequences (%20 for space, %3F for ?, %25 for %, etc.) and properly reconstructs UTF-8 characters from multi-byte percent sequences. If the input contains malformed percent-encoded sequences, an error message will explain the problem.
JavaScript provides two built-in functions for URL encoding. encodeURIComponent() encodes a URI component by escaping all characters except letters, digits, and - _ . ! ~ * ' ( ). It is used for encoding query parameter values and path segments. encodeURI() encodes a complete URI but preserves characters that have special meaning in URIs such as : / ? # [ ] @ ! $ & ' ( ) * + , ; =. Use encodeURIComponent for individual values and encodeURI for complete URLs.
URL encoding is essential when passing user input as query parameters, embedding special characters in URLs, building API requests with dynamic values, and encoding file paths that contain spaces or international characters. This tool processes everything locally in your browser, ensuring your URLs and data remain private.
encodeURI is for encoding a complete URL — it preserves URL-reserved characters like /, :, ?, #, &, =. Use it when encoding a full URL string. encodeURIComponent is for encoding a single component (a query parameter value, a path segment, etc.) — it encodes ALL reserved characters because the component might be embedded inside a URL where those characters have special meaning. Rule of thumb: use encodeURIComponent for query parameter values; use encodeURI when handling a complete URL.
URL encoding is required whenever you put non-ASCII characters, spaces, or URL-reserved characters (?, &, #, /, etc.) into a URL. Common cases: passing user input as query parameters, building API request URLs with dynamic values, encoding file paths with spaces or international characters, and constructing redirect URLs.
Yes. The encoder uses the browser's native encodeURI/encodeURIComponent functions, which fully support UTF-8 multi-byte characters including emojis, Chinese, Japanese, Korean, Arabic, Hebrew, Cyrillic, and accented Latin characters.
Yes. All encoding and decoding happens in your browser. Nothing is sent to any server. The page works offline once loaded — safe for sensitive URLs, API endpoints, or confidential parameters.
A modern code editor with live preview, built for web developers and designers.
Try Phoenix Code