Text & web utilities

URL percent encoder and decoder

Encode or decode individual UTF-8 URL components and form values with the correct handling of spaces and plus signs.

Your settings

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Generate result.

Report an issue

Try it, understand it

Explore the result

Encode or decode individual UTF-8 URL components and form values with the correct handling of spaces and plus signs.

Worked example comparison
ExampleOutputWhat to notice
Worked exampleResultcaf%C3%A9%20%26%20teaThe component café & tea becomes caf%C3%A9%20%26%20tea.
Decode a form valueResulta+b testThe literal plus is encoded, while the intervening plus means space.

Check your understanding

How do I preserve a plus sign in a form value?

Encode the plus as %2B. An unescaped plus is read as a space when decoding form data.

What does the “Decode a form value” setting illustrate?

The literal plus is encoded, while the intervening plus means space.

Behind the tool

How this tool works

Apply component encoding to one parameter value or one path segment at a time. Form mode follows the query form convention in which plus represents a space and a literal plus must be encoded.

THE OUTPUT RULEEncode reserved bytes as percent followed by two hexadecimal digits. Form mode also represents spaces with plus.

A worked example

The component café & tea becomes caf%C3%A9%20%26%20tea.

Good to know

The tool processes one component or form value. Decode rejects malformed UTF-8 or incomplete percent sequences.

How the inputs affect the result

Keep delimiters such as the slash between path segments or ampersand between query fields outside the component you encode. Otherwise they become ordinary text bytes in the value.

The literal plus is encoded, while the intervening plus means space.

Where the calculation applies

The tool processes one component or form value. Decode rejects malformed UTF-8 or incomplete percent sequences.

For a related calculation, see the Base64 and Base64url UTF-8 encoder decoder.

A few questions, answered

How do I preserve a plus sign in a form value?

Encode the plus as %2B. An unescaped plus is read as a space when decoding form data.

What does the “Decode a form value” setting illustrate?

The literal plus is encoded, while the intervening plus means space.

Find your calculator

Start typing to explore the library.