DevToolBoxฟรี
บล็อก

ตัวเข้ารหัส / ถอดรหัส URL

เข้ารหัสหรือถอดรหัส URL และคอมโพเนนต์ URI รองรับ encodeURIComponent และ encodeURI ฟรี ไม่ต้องสมัครสมาชิก

เกี่ยวกับการเข้ารหัส URL

การเข้ารหัส URL จะแทนที่อักขระ ASCII ที่ไม่ปลอดภัยด้วย "%" ตามด้วยเลขฐานสิบหก 2 ตัว สิ่งนี้จำเป็นสำหรับการส่งอักขระพิเศษใน URL พารามิเตอร์ query และข้อมูลฟอร์ม ใช้ encodeURIComponent สำหรับพารามิเตอร์ query และ encodeURI สำหรับ URL เต็มรูปแบบ

คำถามที่พบบ่อย

𝕏 Twitterin LinkedIn

ให้คะแนนเครื่องมือนี้

4.7 / 5 · 107 คะแนน

อัปเดตข่าวสาร

รับเคล็ดลับการพัฒนาและเครื่องมือใหม่ทุกสัปดาห์

ไม่มีสแปม ยกเลิกได้ตลอดเวลา

Enjoy these free tools?

Buy Me a Coffee

วิธีใช้งาน

  1. Enter text in the input field
  2. Choose between URI Component or Full URI encoding mode
  3. Click 'Encode' or 'Decode'
  4. Copy the result

กรณีการใช้งาน

  • Encoding query parameters in URLs
  • Encoding form data for submission
  • Handling special characters in API requests
  • Debugging URL encoding issues

คำถามที่พบบ่อย

What is URL encoding?
URL encoding replaces unsafe ASCII characters with a '%' followed by two hex digits. This ensures special characters are safely transmitted in URLs.
What's the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL but preserves characters like :, /, ?, &. encodeURIComponent encodes everything including those characters, making it suitable for query parameter values.
When should I URL encode?
Always URL encode when passing user input as query parameters, form data, or any URL component that may contain special characters like spaces, &, =, or #.