Dekoduj ciągi zakodowane w URL z powrotem do czytelnego tekstu.
Czym jest dekodowanie URL?
Dekodowanie URL to proces konwersji znaków zakodowanych procentowo z powrotem do ich oryginalnej formy. Gdy dane są zakodowane w URL, znaki specjalne są zastępowane znakiem % po którym następują wartości szesnastkowe. Ten dekoder odwraca ten proces, przywracając oryginalny tekst.
Common Uses of URL Decoding
- Reading Query String Parameters: When analyzing URLs from browser address bars, analytics, or logs, query parameters are often URL-encoded. To understand what values users searched for or what filters they applied, decode the parameters. For example, ?q=coffee+%26+tea decodes to "coffee & tea". Web frameworks automatically decode parameters, but when working with raw URLs or building custom parsers, you must decode manually.
- Server Log Analysis: Web server logs (Apache, Nginx) record URLs with percent-encoding intact. When analyzing access logs to find popular search terms, detect attack patterns, or debug 404 errors, decode URLs to see what users actually requested. For example, /search?q=%22hello+world%22 decodes to /search?q="hello world".
- Debugging Web Applications: During development, inspect URLs in your browser's developer tools network tab. Encoded parameters can be hard to read. Decoding them helps you verify that your application is sending correct data. This is especially useful for complex URLs with multiple encoded parameters, nested objects, or JSON strings passed as URL parameters.
- API Development and Testing: When building or testing APIs that accept URL parameters, decode incoming parameters to validate that clients are sending correct data. This helps diagnose issues where parameter values are double-encoded, incorrectly encoded, or contain unexpected characters. API testing tools like Postman show encoded URLs. Decoding helps verify the actual values being sent.
Jak korzystać z tego dekodera URL
seo.url_decode.how_desc
- Wklej swój ciąg zakodowany w URL w powyższe pole wejściowe.
- Kliknij przycisk "Dekoduj URL".
- Zdekodowany wynik pojawi się w polu wyjściowym.
- Użyj przycisku "Kopiuj wynik", aby skopiować zdekodowany tekst.
seo.url_decode.how_example
Understanding URL Decoding
Kodowanie URL zostało ustandaryzowane w RFC 3986 (2005), który definiuje składnię Uniform Resource Identifier (URI). Standard określa, które znaki są bezpieczne (A-Z, a-z, 0-9, -, _, ., ~) i które muszą być zakodowane procentowo. Przed RFC 3986 różne systemy używały różnych metod, co prowadziło do problemów z kompatybilnością.
Security Considerations When Decoding URLs
Be cautious when decoding URLs from untrusted sources. Validate and sanitize decoded content before using it in your application to prevent injection attacks. Learn about encoding security
Dekodowanie URL w językach programowania
Dekodowanie URL jest wbudowane w większość języków programowania. Oto przykłady:
// urldecode() - decodes form encoding (+ becomes space)
$decoded = urldecode($encoded);
// rawurldecode() - RFC 3986 compliant (+ stays as +)
$decoded = rawurldecode($encoded);
// Parsing query strings (automatic decoding)
$url = 'https://example.com/search?q=coffee+%26+tea';
$parts = parse_url($url);
parse_str($parts['query'], $params);
// $params['q'] is automatically decoded: "coffee & tea"
// decodeURIComponent() - standard decoding (recommended)
const decoded = decodeURIComponent('hello%20world%20%26%20stuff');
// Result: "hello world & stuff"
// Handle plus signs manually if needed
function decodeFormData(str) {
return decodeURIComponent(str.replace(/\+/g, ' '));
}
// Parsing URL parameters
const url = new URL('https://example.com/search?q=coffee+%26+tea');
const query = url.searchParams.get('q');
// Automatically decoded: "coffee & tea"
from urllib.parse import unquote, unquote_plus, parse_qs
# unquote() - standard decoding (+ stays as +)
decoded = unquote('hello%20world%20%26%20stuff')
# Result: "hello world & stuff"
# unquote_plus() - form decoding (+ becomes space)
decoded = unquote_plus('hello+world+%26+stuff')
# Result: "hello world & stuff"
# Parsing query strings (automatic decoding)
params = parse_qs('q=coffee+%26+tea&page=1')
# params['q'] = ['coffee & tea']
import (
"net/url"
"fmt"
)
// QueryUnescape() - decodes query strings (+ becomes space)
decoded, err := url.QueryUnescape("hello+world+%26+stuff")
if err != nil {
fmt.Println("Decoding error:", err)
}
// Result: "hello world & stuff"
// PathUnescape() - decodes paths (+ stays as +)
decoded, err := url.PathUnescape("hello%2Fworld")
// Result: "hello/world"
// Parsing URL parameters (automatic)
u, _ := url.Parse("https://example.com/search?q=coffee+%26+tea")
query := u.Query().Get("q")
// Automatically decoded: "coffee & tea"
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
// URL decoding (always specify UTF-8)
try {
String decoded = URLDecoder.decode("hello+world+%26+stuff",
StandardCharsets.UTF_8);
// Result: "hello world & stuff"
} catch (Exception e) {
System.err.println("Decoding error: " + e.getMessage());
}
require 'uri'
require 'cgi'
# URI.decode_www_form_component() - form decoding
decoded = URI.decode_www_form_component('hello+world+%26+stuff')
# Result: "hello world & stuff"
# CGI.unescape() - alternative
decoded = CGI.unescape('hello+world')
# Result: "hello world"
# Parsing query strings (automatic)
params = URI.decode_www_form('q=coffee+%26+tea&page=1')
# params = [['q', 'coffee & tea'], ['page', '1']]
using System;
using System.Web;
using System.Net;
// HttpUtility.UrlDecode() - form decoding (+ becomes space)
string decoded = HttpUtility.UrlDecode("hello+world+%26+stuff");
// Result: "hello world & stuff"
// Uri.UnescapeDataString() - standard decoding (no System.Web)
string decoded = Uri.UnescapeDataString("hello%20world%20%26%20stuff");
// Result: "hello world & stuff"
Related Tools
Need to encode text for URLs? Use our URL Encoder to convert special characters to percent-encoded format.
Decoding Base64 strings? Try our Base64 Decoder for Base64-encoded data.
Decoding HTML entities? Use our HTML Entity Decoder to convert < > & back to characters.