Skip to main content
Developer ToolsAugust 24, 2026 · 2 min read

How to URL-Encode Text (Percent-Encoding Explained)

Percent-encode text for safe use in a URL — spaces, symbols, and Unicode characters handled correctly, the same way a browser encodes them.

By QR Ivify Team

How to URL-Encode Text (Percent-Encoding Explained)

A search query with spaces in it, a value containing an ampersand or question mark that would otherwise break a URL's structure, non-English text going into a query parameter — URL encoding (percent-encoding) is what makes arbitrary text safe to embed inside a URL without corrupting it.

Why URLs Need Encoding at All

A URL has structural characters with specific meanings — ? starts the query string, & separates parameters, / separates path segments, %20 (not a literal space) represents a space. If the value you're putting into a URL happens to contain any of those characters, or contains non-ASCII text a URL can't represent directly, it needs to be percent-encoded first: each problematic character gets replaced with % followed by its hex byte value. hello world becomes hello%20world; ? becomes %3F.

Component Encoding vs. Whole-URL Encoding

This is the detail that trips people up: QR Ivify's URL Encoder encodes text as a URL component — meaning it percent-encodes structural characters like /, :, and ? too, not just spaces and symbols. That's exactly right for a value going into a query parameter (?q=<encoded value>), but it's the wrong tool for encoding an entire, already-structured URL you want to keep navigable — encoding https://example.com as a component turns the whole thing into https%3A%2F%2Fexample.com, which is correct if that whole string is itself a value (like a redirect URL passed as a parameter), but not what you want if you're trying to "clean up" a URL you intend to visit directly.

Step by Step

  1. Open the URL Encoder.
  2. Paste text or a URL into the box.
  3. Click "Encode."
  4. Copy the percent-encoded result.

A Worked Example

Input: https://example.com/search?q=hello world

Output: https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world

Frequently Asked Questions

Does this handle Unicode text correctly? Yes — non-English characters are percent-encoded correctly, the same way a browser encodes them.

Will this encode an entire URL, or just a value? It encodes the whole input as a single component — characters like / and : get encoded too, which is what you want for a query parameter value, not for a complete URL you want to keep navigable.

Does this upload my text anywhere? No. Encoding happens entirely in your browser.

Try It

Need to percent-encode a value for a URL? QR Ivify's free URL Encoder handles spaces, symbols, and Unicode correctly. Need to decode an encoded URL instead? Try URL Decoder. Encoding something else entirely? See Base64 Encoder.

url encoderdeveloper toolstutorial

Related articles