URL encoder

Processed in this browser

Text limit: 2000000 characters

This tool never uploads your input.

Percent-encode a full URL (`encodeURI`) or a single component (`encodeURIComponent`), and decode. Using the wrong one is how `?q=a+b` turns into a 400. This is not HTML entity encoding.

A query value has spaces and ampersands. That is this page: encodeURI vs encodeURIComponent, plus decode.

HTML entity encoder is &. Slugify is a permalink.

Which function

  • encodeURI — you already have a full URL and need non-ASCII / spaces fixed without breaking ? and &.
  • encodeURIComponent — one parameter value.
encodeURIComponent("a&b=c")  // a%26b%3Dc
encodeURI("https://ex.test/?q=a b")  // encodes the space, keeps ? and =

Honest limits

  • Not a URL parser/builder with punycode UI.
  • Not Base64.
  • Wrong decode of form + is on you.

This is a local encoder, not a crawler.

FAQ

When do I use encodeURIComponent?

For a path segment or query *value*. It encodes &, =, and ?. encodeURI leaves those so a full URL still parses.

Is `+` a space?

In application/x-www-form-urlencoded, yes. decodeURIComponent does not treat + as space. Form bodies and URLs disagree; that is a real footgun.

HTML entities?

HTML entity encoder. Different alphabet.

Slug?

Slugify makes my-post-title. This page makes %20.

Is the URL uploaded?

No.

Related tools