URL Encoder

Encode text for URLs.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Paste text and get it percent-encoded for use as a single URL component, such as a query-string value. It uses encodeURIComponent, so characters like / ? & = # and spaces are all escaped. Do not paste a whole URL expecting it to stay usable.

How to use

1
Step 1
Paste the text or value to encode.
2
Step 2
Press Run.
3
Step 3
Copy the encoded string into your URL.

How it works

Every character except A-Z a-z 0-9 and - _. ! ~ * ' ( ) is replaced by %XX, using the UTF-8 bytes of the character. A space becomes %20, not +. Because reserved characters are escaped too, encode a value, not a full URL.

Worked example

A URL used as a parameter value

Input
https://example.com/search?q=a b&lang=fr
Output
https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Da%20b%26lang%3Dfr
Walkthrough
: / ? = & and the space are all escaped, which is what you want when this whole URL is the value of another URL's parameter such as ?redirect=.

Limitations

  • Escapes reserved characters, so encoding a full URL breaks its structure.
  • Spaces become %20; form-style + encoding is not produced.

Questions

How do I URL-encode a string?
Paste it and press Run. The tool replaces unsafe characters with %XX codes.
Why is / turned into %2F?
This tool encodes a single component, so reserved characters including slash are escaped.
Is a space %20 or +?
This tool produces %20. The URL decoder also reads + as a space.
Does it encode non-English text?
Yes. Each character is encoded as its UTF-8 bytes, for example é becomes %C3%A9.

Features

  • encodeURIComponent behavior
  • UTF-8 aware
  • Runs in your browser

Guides

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • How base64 encoding works

    Andrew Schmelyun

    Clear mental model for Base64 tools and data-URL workflows.

    Watch on YouTube
  • Learn Regular Expressions - Crash Course

    freeCodeCamp.org

    Regex primer for tester and explainer pages.

    Watch on YouTube