Skip to content
Back to skills

Jwt Decode

ASecurity

Decode and inspect JWT tokens from command line. Check expiration, extract claims, debug auth. No more jwt.io tabs. Free CLI tool.

  • 21 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 7, 2026
toolsbashgit

Works with

  • terminal
  • cli

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill jwt-decode --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Jwt Decode?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Jwt Decode
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-jwt-decode/badge)](https://www.skillsdirectory.com/skills/modbender-jwt-decode)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: JWT Decode - Token Inspector CLI
description: Decode and inspect JWT tokens from command line. Check expiration, extract claims, debug auth. No more jwt.io tabs. Free CLI tool.
---

# JWT Decode

Decode JWTs from the terminal. See what's inside, check if expired.

## Installation

```bash
npm install -g @lxgicstudios/jwt-decode
```

## Commands

### Decode Token

```bash
npx @lxgicstudios/jwt-decode eyJhbGciOiJIUzI1NiIs...

# Works with Bearer prefix
npx @lxgicstudios/jwt-decode "Bearer eyJhbGci..."
```

### From Environment Variable

```bash
echo $AUTH_TOKEN | npx @lxgicstudios/jwt-decode
```

### From File

```bash
npx @lxgicstudios/jwt-decode -f token.txt
```

### Check if Expired

```bash
npx @lxgicstudios/jwt-decode --check $TOKEN && echo "Valid" || echo "Expired"
```

### Extract Specific Claim

```bash
npx @lxgicstudios/jwt-decode -c sub $TOKEN
npx @lxgicstudios/jwt-decode -c email $TOKEN
```

## Example Output

```
Header
──────
  alg: "HS256"
  typ: "JWT"

Payload
───────
  sub: "1234567890"
  name: "John Doe"
  email: "john@example.com"
  iat: 1706547200 (2024-01-29T16:00:00.000Z)
  exp: 1706633600 (2024-01-30T16:00:00.000Z)

Status
──────
  Valid - expires in 23 hours
```

## Options

| Option | Description |
|--------|-------------|
| `-f, --file` | Read from file |
| `-c, --claim` | Extract specific claim |
| `--header` | Show only header |
| `--payload` | Show only payload |
| `--json` | JSON output |
| `--check` | Exit 1 if expired |

## Common Use Cases

**Debug auth token:**
```bash
npx @lxgicstudios/jwt-decode $AUTH_TOKEN
```

**Get user ID from token:**
```bash
npx @lxgicstudios/jwt-decode -c sub $TOKEN
```

**Use in scripts:**
```bash
if npx @lxgicstudios/jwt-decode --check $TOKEN 2>/dev/null; then
  echo "Token valid"
else
  echo "Token expired, refreshing..."
fi
```

## Features

- Colored, readable output
- Automatic Bearer prefix handling
- Human-readable expiration times
- Timestamp conversion
- Script-friendly exit codes
- JSON output mode

---

**Built by [LXGIC Studios](https://lxgicstudios.com)**

🔗 [GitHub](https://github.com/lxgicstudios/jwt-decode) · [Twitter](https://x.com/lxgicstudios)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.