URL Encode/Decode + URL Parser Online
Encode/decode URL component (percent-encoding) + parse URL break thành protocol/host/path/query/fragment với decoded params table. Native URL API.
https%3A%2F%2Fexample.com%2Fpath%3Fq%3Dhello%20world%26lang%3Dvi
Vì sao dùng tool này
Dùng URL constructor của browser — chuẩn WHATWG, hỗ trợ IDN domain, IPv6, đầy đủ.
Paste URL phức tạp → break thành table key→value với mỗi value decoded sẵn.
Encode tất cả reserved chars chuẩn RFC 3986. Decode lại pixel-perfect.
Cách sử dụng
- 1Chọn mode: Encode / Decode / Parse.
- 2Paste URL hoặc string vào textarea.
- 3Encode: dấu cách + special chars → %xx. Decode: ngược lại. Parse: break thành table.
URL Encoding là gì?
URL encoding (percent-encoding) là cơ chế đại diện ký tự non-ASCII hoặc reserved trong URL bằng dạng %xx (hex). Vd dấu cách → %20, dấu & → %26.
Reserved characters (RFC 3986): ! * ' ( ) ; : @ & = + $ , / ? # [ ]. encodeURIComponent encode hầu hết, encodeURI giữ một số an toàn cho URL chung.
- ✓encodeURIComponent / decodeURIComponent
- ✓URL parser native (WHATWG)
- ✓Query params table decoded
- ✓Support IDN, IPv6, port
- ✓Protocol / host / path / hash break
- ✓100% client-side
Câu hỏi thường gặp
encodeURI vs encodeURIComponent?
encodeURI dùng cho full URL (giữ : / ? & = #). encodeURIComponent cho 1 component (encode tất cả). Tool default dùng encodeURIComponent — chặt chẽ hơn.
Sao Parse mode báo invalid URL?
URL constructor strict. Cần full form 'https://...' — nếu chỉ 'example.com' sẽ fail. Thêm protocol trước.
Tiếng Việt có encode đúng không?
Có. UTF-8 chuẩn — 'ăn' → %C4%83n. Decode khôi phục đúng.