Monu Tools

สร้าง JWT

สร้างและลงชื่อ HS256 JSON Web Tokens จาก payload และ secret ทั้งหมดในเบราว์เซอร์ของคุณ

วิธีใช้ JWT Generator

  1. 01

    แก้ไข payload เป็น JSON object

  2. 02

    ป้อน HS256 secret ของคุณ

  3. 03

    สร้างและคัดลอก token ที่ลงชื่อแล้ว

Sign tokens in the browser

A JWT generator that builds and signs JSON Web Tokens from your payload and secret, entirely in your browser using the Web Crypto API. It pairs with the JWT decoder, which inspects an existing token.

How a JWT is put together

A JWT has three parts separated by dots: a header, a payload of claims, and a signature, each Base64url encoded. The signature is what makes the token trustworthy: it proves the payload has not been altered and was issued by someone who holds the secret.

HS256 and your secret

This tool signs with HS256, that is HMAC using SHA-256, the most common symmetric JWT algorithm. The same secret both signs and verifies the token, so it must be kept private on the server.

For HS256, use a long, random secret. A short or guessable secret undermines the whole token, since anyone who guesses it can mint valid tokens of their own.

Encoded, not encrypted

An important point about JWTs: the payload is only encoded, not encrypted. Anyone with the token can read its claims by Base64-decoding them, so never put passwords or sensitive data in a JWT. The signature stops tampering, it does not provide secrecy.

Security note

Because signing happens locally, your secret and payload never leave your device. Even so, avoid pasting real production secrets on a shared or public computer.

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

ใช้ algorithm ใด?

HS256 (HMAC กับ SHA-256) ซึ่งเป็น symmetric JWT algorithm ที่พบบ่อยที่สุด ลงชื่อในเบราว์เซอร์ของคุณด้วย Web Crypto API

Secret ของฉันถูกส่งไปที่ไหนไหม?

ไม่ การลงชื่อเกิดขึ้นทั้งหมดในเบราว์เซอร์ของคุณ ดังนั้น secret และ payload จะไม่ออกจากอุปกรณ์ อย่างไรก็ตาม หลีกเลี่ยง production secrets จริงบนเครื่องที่ใช้ร่วมกัน

ฉันสามารถ decode token ด้วยได้ไหม?

ใช่ ใช้เครื่องมือ JWT decoder เพื่อตรวจสอบส่วนหัวและ payload ของ token ที่มีอยู่

แหล่งข้อมูล

ฝังเครื่องมือนี้

เพิ่มเครื่องมือนี้ลงในเว็บไซต์ของคุณเอง คัดลอกสคริปต์ด้านล่าง โดยจะอัปเดตให้เป็นปัจจุบันโดยอัตโนมัติ

<iframe src="https://monu.tools/embed/th/jwt-generator" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>

เครื่องมือที่เกี่ยวข้อง