URL Encoder / Decoder
Encode or decode URLs and URL components. Parse URLs into their parts. Runs in your browser.
encodeURIComponent — encodes everything except letters, digits, and - _ . ! ~ * ' ( )
URL encoding (also called percent-encoding) converts characters that are not allowed or have special meaning in a URL into a safe representation — a percent sign followed by two hex digits. A space becomes %20, an ampersand becomes %26, and so on. This tool encodes and decodes strings using three modes: URL Component (encodeURIComponent), Full URL (encodeURI), and Form Data (space-as-plus). It also parses full URLs into their component parts using the browser's native URL API.
How to use
- Select Encode or Decode. Encode converts plain text to percent-encoded form. Decode converts a percent-encoded string back to plain text. Both directions are live: editing either side updates the other.
- Choose an encoding type. URL Component is the default and correct choice for encoding individual values like query parameter values or path segments. Full URL preserves the structure of a complete URL. Form Data uses
+for spaces instead of%20, matching HTML form POST submissions. - Paste your text. The output updates automatically as you type. Both textareas are editable — you can type in either side and the other will update accordingly.
- Parse a URL (optional). With a full URL in the input, click Parse URL to break it into protocol, hostname, port, pathname, query parameters, and hash fragment. Each query parameter value is shown decoded for easy reading.
Tips for best results
- Use URL Component for query parameter values. If you're building a URL manually and need to encode the value of a query parameter, URL Component is correct. It encodes the
&and=characters that separate parameters, so the encoded value can be safely included without breaking the URL structure. - Use Full URL only for complete URLs.
encodeURIdeliberately leaves characters like?,&,=,#, and/unencoded because they have structural meaning in a URL. If you encode a query parameter value with Full URL mode, those characters will pass through unencoded and break your URL. - Form Data is for POST bodies, not URLs. HTML forms with
method="POST"andapplication/x-www-form-urlencodedencoding use+to represent spaces. This differs from URL encoding where spaces are%20. If you're decoding a form submission body, use Form Data mode. - Use the parser to debug query strings. Pasting a complex URL with many query parameters into the parser and viewing the decoded key-value table is faster than manually decoding each parameter.
Why use PixMidas
- 100% private. All encoding and parsing uses native JavaScript APIs in your browser. Nothing is sent to any server.
- Three encoding modes. URL Component, Full URL, and Form Data cover every common percent-encoding scenario in one tool.
- Built-in URL parser. The URL parser splits any valid URL into its structural components and decodes query parameter values — useful for debugging API calls, OAuth redirects, and complex query strings.
- Bidirectional editing. Both textareas are live — you can type or paste on either side and the other updates instantly.
- No account needed. Free, instant, no character limits.
Frequently asked questions
What is URL encoding and when do I need it?
URL encoding converts characters that are not safe in a URL into a percent-followed-by-two-hex-digits sequence. Characters outside the ASCII unreserved set (letters, digits, - _ . ~) must be percent-encoded when they appear in a URL. You need URL encoding when you're including user-supplied data in a URL — for example, a search query, a file path, or an email address as a query parameter value. Forgetting to encode special characters like &, =, or + in query values breaks the URL structure and produces wrong results in the receiving server.
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent encodes everything except the 84 characters in the unreserved set: letters, digits, and - _ . ! ~ * ' ( ). It is the correct function for encoding individual URL components like query parameter values, path segments, and fragment identifiers. encodeURI additionally leaves the following characters unencoded: ; , / ? : @ & = + $ # — the characters that form URL structure. encodeURI is only appropriate for encoding a complete URL that is already correctly formed, where you only want to escape characters that would break URL parsing entirely.
What is Form Data encoding and how is it different?
HTML forms with method="POST" and the default application/x-www-form-urlencoded content type encode the form body using a modified version of URL encoding: spaces are encoded as + instead of %20, and everything else is encoded the same way as encodeURIComponent. This is the format you see in POST request bodies when inspecting form submissions in browser devtools. When decoding a form-encoded string, the plus signs must be converted back to spaces before applying decodeURIComponent.
What characters actually need to be percent-encoded?
In a URL, any character outside the ASCII unreserved set must be percent-encoded. The unreserved characters are: A–Z, a–z, 0–9, -, _, ., and ~. All other characters — spaces, unicode characters, punctuation, and characters like &, =, ?, #, / — must be percent-encoded when they appear as data values (not as structural URL characters). Non-ASCII characters like accented letters and emoji are first converted to UTF-8 bytes, and each byte is percent-encoded separately.
Can you accidentally double-encode a URL?
Yes. If you encode a string that already contains percent-encoded sequences, the % characters themselves get encoded to %25. For example, %20 becomes %2520. This is a common bug when encoding a URL that was already partially encoded, or when encoding output that was copied from a browser address bar (which already shows encoded characters in some browsers). If you see %25 sequences in an encoded URL, the input was likely already encoded. Decode once first to get the clean string, then re-encode if needed.
Why does the parser show an error for my URL?
The parser uses the browser's native URL constructor, which follows the WHATWG URL specification. It requires a fully qualified URL with a scheme (e.g. https:// or http://). Relative URLs like /path/to/page, bare hostnames like example.com, and malformed URLs without a scheme will fail to parse. Prepend https:// to parse a hostname or path without a scheme.