URL encoder and decoder

Percent-encode a value or decode one back, choosing between a single query value and a whole URL, with the parts listed out when the input is a URL.

Direction
Scope
Encoded
The result appears here

Questions

One value or the whole URL?+

One value escapes everything, including the slashes and the ampersands, which is what a query value needs. Whole URL leaves the structural characters alone so the address still works.

Why did my plus sign become a space?+

Because form encoding uses + for a space while percent encoding uses %20. If a value came from a form body, replace + with a space before decoding it.

What is the parts list under the output?+

When the input parses as a URL, it is broken into protocol, host, path, each query parameter and the fragment, already decoded. It is the fastest way to see which parameter is malformed.

My value is arriving with %2520 in it. What happened?+

It was encoded twice: %20 became %2520 when the already-encoded string was passed through an encoder again. Encode once, at the point where the value is put into the URL, and never on a string that is already a URL.

Related tools

The tools are free. So is most of the library.

1935 blocks and 989 pieces for shadcn/ui and Tailwind, built on the same tokens these tools write. Install one with a command and the code is yours.

No signup for the tools. MIT for free blocks, commercial licence for Pro.

Markdown version