URL Encoder / Decoder
Percent-encode or decode query strings, path segments, and form values. Handles reserved characters, spaces, and Unicode.
How it works
URLs can only contain a limited set of ASCII characters. Anything else — spaces, quotes, Unicode, reserved delimiters used out of context — has to be percent-encoded: replaced by a `%` followed by two hex digits per UTF-8 byte. This matters any time you build a URL from user input, a database query, or a piece of configuration.
JavaScript offers two built-ins: `encodeURI` (leaves structural characters like `/`, `?`, and `#` unencoded, suitable for a whole URL) and `encodeURIComponent` (stricter, used for individual query parameters or path segments). This tool uses `encodeURIComponent` because that is the safer default when you are not sure whether your input contains literal delimiters.
Things to watch for: the old `+` = space convention is only valid inside `application/x-www-form-urlencoded` form bodies, not in paths. Always pick one or the other and be consistent. Decoding malformed input (e.g., a lone `%` without two hex digits) throws — the tool surfaces the error instead of silently mangling the string.
Frequently asked questions
- What is the difference between encodeURI and encodeURIComponent?
- encodeURI leaves reserved characters like / ? # alone, while encodeURIComponent encodes everything. This tool uses encodeURIComponent (stricter) by default.
- How do I decode only — not encode?
- Prefix the input with `decode:` in the playground, or use the mode toggle on the page.
- Does this handle + vs %20 correctly?
- Yes. Query strings historically use + for space; this encoder uses %20 which is valid everywhere. The decoder accepts both.
Related tools
- Base64 Encoder / DecoderBase64 encode or decode any text online. UTF-8 safe, handles emoji and multi-byte characters correctly. Runs entirely in the browser.
- JSON to YAML ConverterConvert JSON to clean, human-readable YAML instantly. Runs fully in your browser — no upload, no tracking.
- YAML to JSON ConverterConvert YAML to JSON (pretty-printed, 2-space indent) in your browser. Handles anchors, multi-doc files, and nested structures.
- JSON to CSV ConverterConvert a JSON array of objects to CSV online. Auto-detects columns, escapes quotes, supports nested fields via dot notation.