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

URL encoding uses the browser's built-in encodeURIComponent and decodeURIComponent functions. Query string parsing uses the native URLSearchParams API. Everything runs locally using browser-native APIs.

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 yourselfin your browser's DevTools Network tab.

Technical specification

Percent-encoding (URL encoding) is defined in RFC 3986 §2.1 (IETF, 2005). Each octet is represented as a % followed by two uppercase hexadecimal digits. Unreserved characters (A–Z, a–z, 0–9, -._~) are never encoded. Reserved characters (:/?#[]@!$&'()*+,;=) are encoded when used outside their syntactic role. This tool uses the browser's native encodeURIComponent / decodeURIComponent functions, which follow the WHATWG URL Standard built on RFC 3986.

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.
Should I use encodeURI or encodeURIComponent?
For an individual value (the part after =), use encodeURIComponent so all special characters are encoded. encodeURI is for whole URLs and leaves structural characters intact.
What happens to spaces in the query string?
Spaces are encoded as %20 by default. Some legacy systems use + instead, the decoder handles both conventions when reversing the operation.
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.

Related tools

Base64
Encode text or files to Base64, decode Base64, or convert images to data URIs.
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.
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.