# URL Encoder, Decoder & Parser

> Percent-encode and decode URLs and query values, and break any URL into protocol, host, path, query parameters and fragment.

- Page: https://notadevblog.com/en/tools/developer/url-encoder/
- German version: https://notadevblog.com/de/tools/developer/url-encoder.md
- Category: Developer

## At a glance

- **Processing:** Locally in your browser, also offline once the page has been opened. Input never leaves your device.
- **Standard:** RFC 3986 and the WHATWG URL Standard
- **Variants:** Component, full URL, form

## For agents

WebMCP: the page registers these functions via document.modelContext in browsers that support it.
ES module: https://notadevblog.com/core/url-encoder.js
Every function returns { "ok": true, ... } or { "ok": false, "error": { "code", "message" } }.

### url_encode_decode

Percent-encode or decode text (RFC 3986). variant "component" works like encodeURIComponent (for query values and path segments), "full" like encodeURI (keeps : / ? # &), "form" is application/x-www-form-urlencoded (space becomes +). Runs locally.

Parameters:
- text (string, required): Text to encode or decode.
- mode (string: encode | decode, default "encode")
- variant (string: component | full | form, default "component")

Example input: `{"text":"Grüße & Küsse","mode":"encode","variant":"component"}`

Deep link (options in the query, user data after #): https://notadevblog.com/en/tools/developer/url-encoder/?mode=encode&variant=component&fn=url_encode_decode#text=Gr%C3%BC%C3%9Fe+%26+K%C3%BCsse

### url_parse

Split an absolute URL into protocol, host, port, path, query parameters and fragment (WHATWG URL Standard). Query parameters are returned decoded, in order, including repeated keys. A password in the URL is reported, never returned.

Parameters:
- url (string, required)

Example input: `{"url":"https://example.com:8080/search?q=hello%20world&lang=de#results"}`

Deep link (options in the query, user data after #): https://notadevblog.com/en/tools/developer/url-encoder/?fn=url_parse#url=https%3A%2F%2Fexample.com%3A8080%2Fsearch%3Fq%3Dhello%2520world%26lang%3Dde%23results

## How to use

1. **Encode or decode:** Use “Component” for a single query value or path segment, “Full URL” to keep :/?#& intact, “Form” for HTML form data where spaces become +.
2. **Inspect a URL:** Paste a URL into the parser to see every part and a decoded table of all query parameters.

## About this tool

Percent-encoding replaces each byte of a character’s UTF-8 form with % and two hex digits, so ü becomes %C3%BC. The parser uses the browser’s own URL API, the same one fetch() uses.

## Frequently asked questions

### Why is a space sometimes %20 and sometimes +?

In URLs a space is %20. HTML forms submitted with application/x-www-form-urlencoded use + instead. Both decode to a space, but only in the matching context.

### Which characters need encoding?

Everything outside A–Z, a–z, 0–9 and - _ . ~ when it is used inside a component. Characters like ? & = # / have a meaning in URLs and must be encoded when they are part of a value.
