URL Encoder

Percent-encode URL query parameters, special URI characters, and text strings into RFC 3986 compliant web addresses.

How to Use the URL Encoder

1

Input URL String

Paste any web URL, search query, or URI parameter text into the input box.

2

Encode Payload

Click Encode URL String to convert special characters (`?`, `=`, `&`, `/`, `:`, `#`, `%`, spaces) to percent-encoded codes.

3

Copy Result

Copy the percent-encoded URI string for use in web applications, OAuth redirect parameters, or API query strings.

Tool Options

RFC 3986 Compliance

Ensures standard UTF-8 percent-encoding for safe transmission across HTTP headers and query strings.

Space Encoding Toggle

Allows choosing between standard `%20` space encoding and form-urlencoded `+` plus character encoding.

Deterministic REST API

Free REST API endpoint (`POST /api/url/url-encoder`) for web scrapers, microservices, and autonomous AI agents.

Your Data Privacy

Web Tool
Privacy-First Architecture
Most of our web tools process your data entirely in-browser. Where server processing is technically required, payloads are evaluated statelessly in-memory and are never stored, saved, or logged.
REST API
Stateless In-Memory Processing
When you use our API endpoints, your requests are processed strictly in-memory without persistent database storage, disk logging, or data retention.
Want to learn more about how we safeguard your information and infrastructure?
Read our full Privacy Policy for detailed security standards, data retention principles, and compliance guarantees.

What does the URL Encoder do?

The URL Encoder converts reserved URI characters (spaces, ampersands, question marks, equals signs, slashes, colons, and hash marks) into UTF-8 percent-encoded hexadecimal sequences (e.g. %20 or +) adhering strictly to RFC 3986 and WHATWG URL specifications.

Core Concepts

Understanding URL percent-encoding rules:

  • Percent-Encoding (RFC 3986): Converts reserved and non-ASCII characters into % followed by their two-digit hexadecimal UTF-8 byte representation (such as %2F for / and %3F for ?).
  • Space Encoding Options: Supports standard RFC 3986 percent-encoding (%20) and application/x-www-form-urlencoded plus-character format (+).
  • Query Parameter Safety: Prevents delimiter collision when passing complex nested values, tokens, and filenames within HTTP GET query strings.

How to use the tool?

  1. Enter URL or Query: Paste your raw web address, query parameter, or text string into the editor or click Load Sample.
  2. Configure Space Encoding: Optionally check Encode spaces as plus (+) instead of %20.
  3. Encode & Copy: Click Encode URL String, then click Copy or Download to export the encoded URI string.

Related Developer Utilities

If you work with web URLs, HTTP parameters, and entity encodings, explore these complementary tools:

REST API Integration

Blueutils provides a free REST API endpoint (POST https://blueutils.com/api/url/url-encoder) to programmatically percent-encode URLs and query parameter strings.

API Request Parameters

Name Type Description Example
rawText String Raw URL or query string to percent-encode. "https://blueutils.com/search?q=hello world"
options.encodeSpaceAsPlus Boolean Optional. Encode spaces as + instead of %20. Default: false. false

API Request Payload Examples

cURL

curl -X POST https://blueutils.com/api/url/url-encoder \
  -H "Content-Type: application/json" \
  -d '{
    "rawText": "https://blueutils.com/search?q=hello world",
    "options": { "encodeSpaceAsPlus": false }
  }'

Python

import requests

url = "https://blueutils.com/api/url/url-encoder"
payload = {
    "rawText": "https://blueutils.com/search?q=hello world",
    "options": {"encodeSpaceAsPlus": False}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())

Java

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        String jsonPayload = """
            {
                "rawText": "https://blueutils.com/search?q=hello world",
                "options": { "encodeSpaceAsPlus": false }
            }
            """;

        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://blueutils.com/api/url/url-encoder"))
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
            .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}

API Response Parameters

Name Type Description Example
isValid Boolean Indicates whether encoding succeeded. true
input String Echoes the input URL payload. "https://blueutils.com/search?q=hello world"
encodedText String Percent-encoded URL string. "https%3A%2F%2Fblueutils.com%2Fsearch%3Fq%3Dhello%20world"
output String Encoded URL result string. "https%3A%2F%2Fblueutils.com%2Fsearch%3Fq%3Dhello%20world"

API Response Payload Examples

Success Response (HTTP 200 OK)

{
  "isValid": true,
  "input": "https://blueutils.com/search?q=hello world",
  "encodeSpaceAsPlus": false,
  "encodedText": "https%3A%2F%2Fblueutils.com%2Fsearch%3Fq%3Dhello%20world",
  "output": "https%3A%2F%2Fblueutils.com%2Fsearch%3Fq%3Dhello%20world"
}

Validation Failure Response (HTTP 400 Bad Request)

{
  "isValid": false,
  "error": "Invalid input: URL payload to encode cannot be empty."
}

Rate Limit Exceeded Response (HTTP 429 Too Many Requests)

{
  "error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}

Why use an API to encode URLs?

Integrating the URL Encoder API into automated web scrapers, crawler jobs, or AI agent tool calling provides key benefits:

  • Rapid Script Validation: Percent-encodes dynamic search parameters and redirect URLs before making HTTP network requests.
  • Optimized Token Efficiency for AI Agents: LLMs frequently miscalculate multi-byte UTF-8 percent sequences. Calling the API encodes special characters deterministically without token hallucinations.
  • Deterministic Accuracy Without Hallucinations: Ensures 100% compliant RFC 3986 character escaping.

Native Usage

How to percent-encode URLs locally in terminal environments or scripts:

Windows (CMD / PowerShell)

# Percent-encode URL string in PowerShell
[System.Uri]::EscapeDataString('https://blueutils.com/search?q=hello world')

Linux / Unix (Bash)

# Percent-encode URL string using jq in Linux
jq -rn --arg x "https://blueutils.com/search?q=hello world" '$x | @uri'

Python

Using Python urllib.parse:

import urllib.parse

raw_url = "https://blueutils.com/search?q=hello world"
encoded = urllib.parse.quote(raw_url, safe='')
print("Encoded:", encoded)

Java

Using Java URLEncoder:

import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

public class UrlEncoderExample {
    public static void main(String[] args) throws Exception {
        String raw = "https://blueutils.com/search?q=hello world";
        String encoded = URLEncoder.encode(raw, StandardCharsets.UTF_8.toString());
        System.out.println("Encoded: " + encoded);
    }
}

Frequently Asked Questions (FAQ)

How do I percent-encode web URLs and query parameters online?

Paste your raw web address or query parameter string into the input box, toggle space encoding preference (%20 or +), and click Encode URL String.

What characters are converted during URL percent-encoding?

Special URI characters including spaces (%20), ampersands (%26), equal signs (%3D), question marks (%3F), colons (%3A), and slashes (%2F) are converted into RFC 3986 hex escape sequences.

Are my URL strings uploaded to remote servers?

No. All URL percent-encoding and UTF-8 string conversions run 100% client-side directly inside your browser. Your URLs remain completely private.

Rate Limits

UI Limits
100 uses per 15 minutes
Max payload size: 5 MB
API Limits
5 requests per 60 minutes
Max payload size: 256 KB
Need higher API rate limits, increased payload sizes, or custom developer solutions?
Contact our engineering team at support@blueutils.com for custom rate limit increases, higher quota allocations, or tailored enterprise integrations.