🛠️DevTools

Create JWT Payload Example

Try:
86 characters
141 characters

⚠️ This is an unsigned token for testing only. For production, sign tokens on your server.

💡 Tip: This tool creates JWT tokens for testing purposes only. The generated tokens have a placeholder signature and should not be used in production. Use a proper JWT library with a secret key for real applications.

Code Examples

Here's how to achieve this in different programming languages:

1// Create unsigned JWT (for testing only)
2const header = { alg: 'HS256', typ: 'JWT' };
3const payload = {
4 "sub": "user_123",
5 "name": "Test User",
6 "role": "admin",
7 "iat": 1616239022
8};
9
10const base64UrlEncode = (obj) => {
11 return btoa(JSON.stringify(obj))
12 .replace(/\+/g, '-')
13 .replace(/\//g, '_')
14 .replace(/=/g, '');
15};
16
17const token = base64UrlEncode(header) + '.' +
18 base64UrlEncode(payload) + '.' +
19 'signature';

More JWT Examples

Related JWT Tools

📚 Learn More