inyourbrowser.com

URL Encode Query Strings

Percent-encode any text so it can safely appear inside a URL query string. Spaces become %20, special characters become their hex codes, and the result drops straight into your URL after the ? or &. Runs in your browser.

Input
Output

URL TOOLS

URL Encode

Encodes special characters using percent-encoding (encodeURIComponent). Safe for use in query string values.

Runs entirely in your browser

How it works

encodeURIComponent also escapes the characters that give a query string its structure: & becomes %26, = becomes %3D, ? becomes %3F, and # becomes %23. Paste only the value, not the whole URL, and put the result after the = sign.

Processing runs in your browser

All encoding, decoding, and parsing happens inside your browser tab. Our servers are not involved at any point. You can see this yourself in your browser's DevTools Network tab.

Technical specification

Percent-encoding (URL encoding) is defined in RFC 3986 §2.1 (IETF, 2005). Each octet is written as % followed by two uppercase hexadecimal digits. Unreserved characters (A-Z, a-z, 0-9, -._~) never need encoding, and reserved characters (:/?#[]@!$&'()*+,;=) are encoded when they appear inside a value. This tool uses JavaScript's encodeURIComponent and decodeURIComponent, defined in the ECMAScript standard (ECMA-262). encodeURIComponent also leaves ! ' ( ) * as they are, so a system that expects strict RFC 3986 output may need those five escaped. Query string parsing uses URLSearchParams from the WHATWG URL Standard, which reads + as a space.

Standard
RFC 3986. Uniform Resource Identifier (URI): Generic Syntax
Encoding unit
One octet → %XX (two uppercase hex digits)
Space encoding
%20 per RFC 3986; + in HTML form data (RFC 1866)
Browser API
encodeURIComponent() / URLSearchParams

Related operations

To encode binary blobs as text, try Base64. For escaping reserved markup characters, use HTML entities. To inspect the encoded query body of a JSON request, see the JSON formatter.

Frequently asked questions

Why do I need to encode query string values?
URLs reserve characters like &, =, ?, /, and # for structural meaning. Encoding ensures user-supplied values do not break the URL or change which query parameters the server sees.
How do I encode a value that contains & or =?
Encode only the value, then put it after the = sign. a&b=c becomes a%26b%3Dc, so the server reads it as one value instead of starting a new parameter.
What happens to spaces in the query string?
Spaces are encoded as %20. Some legacy systems use + instead. The URL decoder turns + back into a space when you tick "Treat + as a space".
Is my data sent to a server?
All processing runs in your browser using JavaScript's built-in encodeURIComponent. Our servers are not involved at any point.

Last reviewed September 30, 2026

Other pages for this tool

Related tools

Base64
Encode text or files to Base64, decode Base64, or convert images to data URIs.
HTML entity encoder
Encode special characters to HTML entities and decode them back. Instant, in your browser.
Slug generator
Convert any text into a URL-safe slug. Handles diacritics, special characters, and custom separators.
QR code generator
Generate QR codes for URLs, plain text, or Wi-Fi credentials. Download as PNG or copy as SVG. Runs in your browser.