Penyandi & Dekoder URL

Sandi atau dekode string dan komponen URL dengan mudah. Alat kami menggunakan encodeURIComponent untuk pemrosesan berbasis browser yang aman. Sempurna untuk pengembang yang bekerja dengan string kueri dan karakter khusus.

Iklan
Iklan

A URL encoder/decoder converts text between plain text and URL-safe format. URL encoding (also called percent encoding) replaces special characters like spaces, ampersands, and non-ASCII characters with percent-prefixed hex codes (e.g., space becomes %20). This ensures URLs work correctly in browsers and APIs. Decoding reverses this process. This tool handles both operations instantly in your browser.

Encode dan dekode URL tanpa mengirim data ke mana pun

Menggunakan `encodeURIComponent` untuk keamanan maksimum. Proses string kueri, segmen jalur, dan karakter khusus. Langsung di browser Anda. Tanpa unggah, tanpa batas.

100% client-side
Hasil instan
Gratis tanpa batas

Cara menggunakan

  1. 1

    Tempelkan String Anda

    Masukkan teks atau URL lengkap yang ingin Anda proses ke dalam bidang 'Input String'.

  2. 2

    Pilih Tindakan

    Klik tombol 'Sandi' untuk mengubah karakter khusus menjadi format penyandian persen, atau klik 'Dekode' untuk mengembalikannya ke bentuk aslinya.

  3. 3

    Salin Hasil

    String yang diproses akan muncul di bidang 'Output'. Klik tombol 'Salin Hasil' untuk menyimpannya ke clipboard Anda.

Mengapa Penyandian URL Diperlukan?

Hanya Karakter ASCII

URL hanya dapat berisi set karakter tertentu dari set ASCII. Karakter apa pun di luar set ini harus disandikan.

Karakter yang Dicadangkan

Karakter yang memiliki arti khusus dalam URL (seperti `&` atau `?`) harus disandikan untuk menghindari salah tafsir oleh server.

Integritas Data

Penyandian memastikan bahwa parameter yang dilewatkan dalam URL (misalnya, kueri pencarian) diinterpretasikan dengan benar sebagai data, dan bukan sebagai bagian dari struktur URL.

Iklan

Memahami Encoding URL

What is URL encoding and why is it needed?

URLs were originally designed to transmit ASCII text over the internet. The URL specification (RFC 3986) reserves certain characters for special purposes: '?' separates the path from the query string, '&' separates parameters, '=' separates keys from values, '#' marks a fragment, and '/' separates path segments. When these characters appear in the data portion of a URL (like a search query or a parameter value), they must be encoded to avoid being interpreted as structural delimiters.

URL encoding (percent encoding) replaces each reserved or non-ASCII character with a percent sign (%) followed by two hexadecimal digits representing the character's byte value. For example, a space becomes %20, an ampersand becomes %26, and a forward slash becomes %2F. Characters in the unreserved set (A-Z, a-z, 0-9, hyphen, underscore, period, tilde) are never encoded. The JavaScript function encodeURIComponent() handles this encoding, while decodeURIComponent() reverses it.

Modern URLs also need to handle Unicode characters (emoji, CJK characters, accented letters). These are first encoded as UTF-8 bytes, then each byte is percent-encoded. For example, the coffee emoji 鈽?(U+2615) is encoded as UTF-8 bytes E2 98 95, which becomes %E2%98%95 in a URL. The browser and server automatically handle this encoding when you type a URL or submit a form, but developers often need to manually encode or decode URLs when building API endpoints, redirect URLs, or data URIs.

Iklan

Common use cases for URL encoding

URL encoding is essential when passing data through URLs in web applications. Common scenarios include: building API query parameters (encoding search terms, filter values), creating redirect URLs that contain the original URL as a parameter (e.g., /login?redirect=%2Fdashboard), generating data URIs for embedded images or fonts, and encoding email links with subject and body parameters (mailto:?subject=...&body=...). OAuth flows also heavily rely on URL encoding for state parameters and callback URLs.

Bug umum adalah double-encoding -- mengodekan string yang sudah dikodekan. Misalnya, mengodekan '%20' akan menghasilkan '%2520' karena '%' dikodekan sebagai '%25'. Selalu periksa apakah string sudah dikodekan sebelum mengodekannya. Alat kami mendeteksi apakah input sudah dikodekan dan memperingatkan Anda.

Iklan

Bagaimana ini dibandingkan dengan encoder URL lain?

Perbandingan langsung alat encoding URL populer.

FiturNovaToolsURL-Encoder.ioMeyerWeb
Encode + Decode dalam satu alatKedua modeHanya encode
Konversi langsung saat mengetikInstanTombol kirim
Handles Unicode/emojiUTF-8Limited
Privasi (tanpa unggah)100% lokalSisi server
Salin dengan satu klik
Berfungsi offline(halaman statis)

Alat kami melakukan semua encoding dan decoding di browser Anda — teks Anda tidak pernah dikirim ke server, membuatnya aman untuk data sensitif.

Pertanyaan yang sering diajukan

Apa itu Penyandian URL?
Penyandian URL, juga dikenal sebagai penyandian persen, adalah mekanisme untuk mengubah karakter yang memiliki arti khusus dalam URL (seperti spasi, '&', '?', '#') menjadi format aman yang dapat ditransmisikan melalui internet. Setiap karakter khusus diganti dengan tanda '%' diikuti oleh kode heksadesimal dua digitnya.
Apakah data saya dikirim ke server?
Tidak. Alat ini berjalan sepenuhnya di dalam browser web Anda. Data Anda tidak pernah diunggah atau disimpan di server mana pun, memastikan privasi dan keamanan 100%.
Apa perbedaan antara encodeURI() dan encodeURIComponent()?
Alat ini menggunakan `encodeURIComponent()`, yang umumnya lebih aman dan lebih teliti. Ini menyandikan karakter yang dicadangkan yang penting untuk struktur URL (seperti `/`, `?`, `&`, `#`) untuk memastikan mereka diperlakukan sebagai teks literal, sedangkan `encodeURI()` akan mempertahankannya.
Kapan saya harus menggunakan URL encoding?
URL encoding is necessary whenever you include data in a URL that contains characters outside the ASCII character set or characters that have special meaning in URL syntax. Common scenarios include: encoding search query parameters (e.g., `?q=hello world` → `?q=hello%20world`), encoding email addresses or usernames in URLs, passing JSON or base64 data in query strings, encoding international characters (UTF-8), and building redirect URLs with nested parameters. If you are building URLs programmatically in JavaScript, always use `encodeURIComponent()` on dynamic values.
Karakter apa yang perlu diodekan?
Characters that must be encoded include: reserved characters with special meaning in URLs (`;`, `,`, `/`, `?`, `:`, `@`, `&`, `=`, `+`, `$`, `#`), unsafe characters that could be misinterpreted (`<`, `>`, `"`, `{`, `}`, `|`, ```, `^`, `~`, `[`, `]`), and non-ASCII characters (any character outside the basic ASCII range 0-127). Spaces are always encoded as `%20` (not `+`, which is a common misconception — `+` is only used for spaces in `application/x-www-form-urlencoded` data, not in URLs). The percent sign itself (`%`) must be encoded as `%25`.
Bisakah alat ini menangani Unicode dan karakter internasional?
Yes. The tool uses `encodeURIComponent()`, which properly encodes Unicode characters using UTF-8 percent-encoding. For example, the Chinese character `你` is encoded as `%E4%BD%A0` (three bytes in UTF-8), and the emoji `🎉` is encoded as `%F0%9F%8E%89` (four bytes). This ensures that international text, emoji, and other non-ASCII characters are correctly transmitted in URLs. When decoding, the tool uses `decodeURIComponent()`, which converts the percent-encoded bytes back to the original UTF-8 characters.
Mengapa URL yang didekode terlihat berbeda dari aslinya?
This can happen for several reasons. First, `+` characters in the input are not converted to spaces by `decodeURIComponent()` — they remain as literal `+` signs. If you need to decode form-encoded data where `+` represents a space, use `decodeURIComponent(input.replace(/`+/g, '%20'))` instead. Second, if the original URL was encoded with a different character set (e.g., Latin-1 instead of UTF-8), the decoded characters may appear garbled. Third, double-encoding (encoding an already-encoded string) will produce `%2520` instead of `%20` — always decode first, then re-encode if needed.
Apakah alat ini berfungsi dengan encoding Base64?
This tool focuses on URL encoding, not Base64 encoding. However, the two are often used together: you Base64-encode binary data (like images or tokens), then URL-encode the result to safely include it in a URL. If you need Base64 encoding, use our dedicated Base64 Encoder/Decoder tool. If you have a Base64 string that contains `+`, `/`, or `=` characters and you want to put it in a URL, paste it here and click Encode — those characters will be percent-encoded to `%2B`, `%2F`, and `%3D` respectively.

Privasi Anda Adalah Prioritas Kami

Alat ini berjalan sepenuhnya di browser Anda. File Anda tidak diunggah, disimpan, atau dianalisis.

  • Kami tidak mengunggah, menyimpan, atau menganalisis file Anda.
  • Semua yang Anda proses tetap di perangkat Anda.
  • Tidak ada pemrosesan sisi server, penyimpanan cloud, atau analisis.

Bahkan jika koneksi internet Anda terputus, file Anda tetap aman.

Anda mungkin juga suka

Panduan terkait

Iklan