URL encoder, decoder, and query editor

Encode a parameter value, read percent-encoded text, or edit a URL’s query parameters. Choose the format that matches your task, then copy or download the result.

Loading the tool…

URL components and form values

Use Encode or Decode for one parameter name or value. Encoding a complete URL this way also escapes its separators, so it is appropriate only when that whole URL is itself a value inside another URL. Use Edit query to work on a URL while keeping its structure.

InputURL componentForm value
hello worldhello%20worldhello+world
a+ba%2Bba%2Bb
a&b=ca%26b%3Dca%26b%3Dc
cafécaf%C3%A9caf%C3%A9
~~%7E

The component format follows JavaScript’s encodeURIComponent: letters, digits, and - _ . ! ~ * ' ( ) stay readable. Form values use the application/x-www-form-urlencoded rules: letters, digits, and * - . _ remain readable, and spaces become +. A literal plus sign is encoded as %2B in both formats.

On decoding, the component format keeps + unchanged; the form format reads it as a space. Each action decodes once: %252F becomes %2F, not /. Invalid percent escapes and invalid UTF-8 byte sequences produce an error rather than a partial result. This tool handles UTF-8 text, not arbitrary binary data or legacy character encodings.

Edit query parameters without losing repeated names

Choose Full HTTP or HTTPS URL for a complete address, or Query string only for text such as tag=css&tag=html&q=hello+world. A leading ? is optional in query-string mode. That mode treats # as part of a value; use full-URL mode to preserve a separate fragment.

Select Read parameters, edit the decoded names and values, and add or remove rows. Repeated names, their order, and empty values are retained. The original input stays visible for comparison. Changing it or its input type clears the rows and result until you read it again. A URL without parameters can be used as a starting point.

Original: https://example.com/?tag=css&tag=html&q=hello%20world#results
Rebuilt:  https://example.com/?tag=css&tag=html&q=hello+world#results

Rebuilding uses form encoding and can change the URL’s spelling. Empty & segments are removed, a bare flag becomes flag=, an empty query marker is removed, and percent escapes are standardized. Browser URL normalization can also lowercase the hostname, remove a default port, or resolve path segments. The fragment is retained in the browser-normalized URL. Review the result before using it: signed URLs and applications that depend on exact query bytes may stop working after normalization.

Full-URL input must start with http:// or https:// and contain no literal spaces, control characters, or backslashes. This is a local editor, not a link checker: it never opens, fetches, or verifies the destination.

Input is limited to 65,536 JavaScript string units and 200 query parameters. The combined decoded names, values, separators, base URL, and fragment use the same text limit when rebuilding. Some characters, including many emoji, occupy two units. Encoded output can be longer than the input. Incomplete Unicode characters are rejected. Input and results stay in memory and are cleared when you leave the page; clipboard copies and downloaded text files remain under your control and may contain secrets.

Use the HTML encoder and decoder for HTML entities such as &. HTML escaping and URL encoding solve different problems. To prepare an HTTP request using a reviewed URL or form body, open the cURL command builder. Values are not transferred between tools.

URL encoding and decoding in code

These examples use the same value, hello + café, to show spaces, a literal plus sign, and UTF-8. Encode individual names and values before joining a query; do not encode its & and = separators. Libraries differ in punctuation, hex-letter case, malformed-input handling, and ordering. The snippets demonstrate their APIs rather than reproducing every validation rule of this tool.

JavaScript and TypeScript

Use encodeURIComponent for a single component and URLSearchParams for form queries. An array of pairs keeps repeated names; turning it into a plain object can discard duplicates. Native URLSearchParams decoding is forgiving, unlike this tool’s strict checks.

const value = "hello + café";
const encoded = encodeURIComponent(value);
console.log(encoded); // hello%20%2B%20caf%C3%A9
console.log(decodeURIComponent(encoded)); // hello + café

const query = new URLSearchParams([
  ["q", value], ["tag", "css"], ["tag", "html"]
]);
console.log(query.toString()); // q=hello+%2B+caf%C3%A9&tag=css&tag=html
console.log(query.getAll("tag")); // ["css", "html"]

Python

The standard urllib.parse module distinguishes quote from quote_plus. Set safe="" when a slash belongs to a value. Use parse_qsl to keep ordered pairs and keep_blank_values=True for empty values. errors="strict" checks UTF-8 decoding but does not reject every malformed percent escape; these examples are not a replacement for this tool’s validation.

from urllib.parse import quote, unquote, quote_plus, unquote_plus, urlencode, parse_qsl

value = "hello + café"
component = quote(value, safe="")
form = quote_plus(value, safe="")
print(component)  # hello%20%2B%20caf%C3%A9
print(unquote(component, errors="strict"))  # hello + café
print(form)  # hello+%2B+caf%C3%A9
print(unquote_plus(form, errors="strict"))  # hello + café

pairs = parse_qsl("tag=css&tag=html&empty=", keep_blank_values=True)
print(urlencode(pairs))  # tag=css&tag=html&empty=

PHP

Use rawurlencode for RFC 3986 component escaping and urlencode for form values. Save the source as UTF-8: PHP encodes the string’s bytes. Punctuation rules differ from JavaScript’s encodeURIComponent. These snippets run in the CLI and do not send a request.

<?php
$value = 'hello + café';
$component = rawurlencode($value);
$form = urlencode($value);

echo $component, PHP_EOL; // hello%20%2B%20caf%C3%A9
echo rawurldecode($component), PHP_EOL; // hello + café
echo $form, PHP_EOL; // hello+%2B+caf%C3%A9
echo urldecode($form), PHP_EOL; // hello + café

C# and .NET

Use Uri.EscapeDataString for a component and WebUtility.UrlEncode for form-style spaces. WebUtility leaves some punctuation, including !, ( and ), unescaped, so it is not byte-identical to this tool’s form serializer. The example uses top-level statements in modern .NET.

using System;
using System.Net;

string value = "hello + café";
string component = Uri.EscapeDataString(value);
string form = WebUtility.UrlEncode(value);

Console.WriteLine(component); // hello%20%2B%20caf%C3%A9
Console.WriteLine(Uri.UnescapeDataString(component)); // hello + café
Console.WriteLine(form); // hello+%2B+caf%C3%A9
Console.WriteLine(WebUtility.UrlDecode(form)); // hello + café

Go

The standard net/url package provides query escaping and decoding. Values.Add keeps repeated values, but Values.Encode sorts keys; it does not preserve the original ordering between different names. PathEscape has different rules and should not substitute for query encoding.

package main

import (
    "fmt"
    "net/url"
)

func main() {
    encoded := url.QueryEscape("hello + café")
    decoded, err := url.QueryUnescape(encoded)
    if err != nil {
        panic(err)
    }
    fmt.Println(encoded) // hello+%2B+caf%C3%A9
    fmt.Println(decoded) // hello + café

    query := url.Values{}
    query.Add("tag", "css")
    query.Add("tag", "html")
    fmt.Println(query.Encode()) // tag=css&tag=html
}

Rust

Add the form_urlencoded crate with cargo add form_urlencoded. Its serializer produces form queries and its parser returns a sequence of pairs. Parsing is forgiving; it does not provide the strict malformed-escape and UTF-8 errors used by this tool.

use form_urlencoded::{parse, Serializer};

fn main() {
    let query = Serializer::new(String::new())
        .append_pair("q", "hello + café")
        .append_pair("tag", "css")
        .append_pair("tag", "html")
        .finish();
    println!("{}", query); // q=hello+%2B+caf%C3%A9&tag=css&tag=html
    let pairs: Vec<(String, String)> = parse(query.as_bytes()).into_owned().collect();
    assert_eq!(pairs[0].1, "hello + café");
    assert_eq!(pairs[1].0, pairs[2].0);
}

Java

URLEncoder and URLDecoder operate on form values, not complete URLs. Specify UTF-8 explicitly. These Charset overloads require Java 10 or later. URLDecoder can replace invalid encoded bytes, so its error behavior differs from this tool.

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

public class UrlExample {
    public static void main(String[] args) {
        String value = "hello + café";
        String encoded = URLEncoder.encode(value, StandardCharsets.UTF_8);
        String decoded = URLDecoder.decode(encoded, StandardCharsets.UTF_8);
        System.out.println(encoded); // hello+%2B+caf%C3%A9
        System.out.println(decoded); // hello + café
    }
}

Swift

Foundation’s addingPercentEncoding takes an allowed character set. This example explicitly selects RFC 3986 unreserved ASCII characters for one value. Do not use the broader query-allowed set to encode an individual value containing & or +. This is component encoding; removingPercentEncoding does not turn a literal plus into a space.

import Foundation

let value = "hello + café"
let allowed = CharacterSet(charactersIn:
    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~")

if let encoded = value.addingPercentEncoding(withAllowedCharacters: allowed),
   let decoded = encoded.removingPercentEncoding {
    print(encoded) // hello%20%2B%20caf%C3%A9
    print(decoded) // hello + café
} else {
    print("Invalid text")
}

Delphi and Object Pascal

Delphi’s TNetEncoding.URL provides encoding and decoding through the RTL; the linked publisher reference is in French. The default example in that reference uses plus signs for spaces, and decoding interprets plus signs as spaces. Its punctuation rules differ from this tool’s form serializer. This is Delphi-specific code, not a guarantee of compatibility with every Object Pascal compiler.

program UrlExample;

{$APPTYPE CONSOLE}

uses
  System.SysUtils, System.NetEncoding;

var
  Value, Encoded, Decoded: string;
begin
  Value := 'hello + caf' + Char($00E9);
  Encoded := TNetEncoding.URL.Encode(Value);
  Decoded := TNetEncoding.URL.Decode(Encoded);
  Writeln(Encoded);
  Writeln(Decoded);
end.

How to use this tool

  1. Choose Encode, Decode, or Edit query.
  2. For conversion, choose URL component or Form value and enter one name or value. The result updates as you type.
  3. For query editing, choose the input type, paste the original, and select Read parameters. Edit the rows and compare the rebuilt result with the original.
  4. Correct any errors, then use Copy result or Download result. If copying is unavailable, select the output and copy it manually. Clear removes the working data.

Your tool data stays in your browser

This tool processes your data on your device. The text, files, or passwords you enter and the results it creates are not sent to our servers or any other server.

Page and asset requests still occur. Production pages also load Google Tag Manager, Cloudflare Web Analytics, and AdSense advertising; tool code does not send inputs or results to analytics or ads. See our privacy policy.

To inspect requests while using the tool, open your browser's developer tools and select Network. Try it with sample data.

Read How to Check Website Network Requests in Chrome, Firefox, Edge and Safari.

References

  • MDN: encodeURIComponent - JavaScript’s rules for encoding a URL component, including which characters remain unescaped and how Unicode is handled.
  • MDN: URLSearchParams - working with query parameters, repeated keys, and form serialization. This tool deliberately rejects malformed escapes instead of applying the API’s forgiving decoding.
  • WHATWG URL Standard - the authoritative rules for parsing and serializing URLs, percent-encoding, and the application/x-www-form-urlencoded format.

Premium is coming soon

An optional premium subscription to remove ads is planned. Subscriptions are not available yet.

You can keep using our free tools without an account.