JsonWebTokenError: jwt must be provided: what it means and how to fix it
Fix JsonWebTokenError: jwt must be provided by decoding safely and locally (no upload).
What the error means
JsonWebTokenError: jwt must be provided means a decoder rejected the input as invalid encoding. The fastest path is to identify what format you have, normalize it, then decode again.
Most common real-world causes
- You called verify/decode with an empty/undefined token.
- JWT problems are often: not 3 segments, wrong key/algorithm, or option mismatch (aud/iss/sub).
- The input is not actually encoded in the expected format (Base64 vs Base64URL vs plain text).
- You copied only part of the string (truncated token/payload).
- Whitespace/newlines were introduced during copy/paste.
- Wrong character set: URL-safe Base64 uses '-' and '_' instead of '+' and '/'.
- You decoded using the wrong function (decodeURIComponent on non-URL-encoded data, atob on non-Base64).
Fast debugging steps
- If you see a JWT library error, decode the token parts first to confirm structure and claims.
- Confirm what you are decoding (URL encoding, Base64, Base64URL, JWT).
- Trim whitespace and remove line breaks before decoding.
- If it's a JWT, ensure it has 3 dot-separated parts (header.payload.signature).
- If it's Base64URL, convert '-' -> '+' and '_' -> '/' and add padding if needed.
Code example (node)
// Node (jsonwebtoken) troubleshooting
const jwt = require('jsonwebtoken');
try {
// 1) Quick structure check
if (token.split('.').length !== 3) throw new Error('JWT must have 3 segments');
// 2) Inspect claims WITHOUT verifying (debug only)
const decoded = jwt.decode(token, { complete: true });
console.log(decoded);
// 3) If you need verification: provide correct key + options
// const payload = jwt.verify(token, publicKeyOrSecret, { algorithms: ['HS256'] });
// console.log(payload);
} catch (e) {
console.error(e.name || 'Error', e.message || String(e));
}
Fix without uploading data
Encoded strings often contain secrets (tokens, IDs). Decode locally and share only redacted snippets.
- URL Encode/Decode for percent-encoding.
- Base64 Encode/Decode for Base64/Base64URL payloads.
- JWT Decoder to inspect header/payload without uploads.
FAQ
Is Base64 the same as Base64URL? No. Base64URL uses '-' and '_' and often omits padding. Normalize before decoding.
Does decoding a JWT verify it? No. Decoding shows claims; verification requires the signing key.
Guides/java jackson cannot deserialize instance java util arraylist out of start
Guides/csharp stj could not be converted system int32 items 0 id
Guides/java org yaml snakeyaml scanner scannerexception while scanning a simple
Guides/java unrecognized token was expecting true false or null
Guides/go json cannot unmarshal object into field user email type string
Guides/csharp stj could not be converted system string items 0 id
Guides/go json cannot unmarshal number into field user createdat type int
Guides/go json cannot unmarshal bool into field meta count type bool
Guides/java jackson cannot deserialize instance java lang boolean out of start a
Guides/go json cannot unmarshal string into field payload items type int
Guides/go json cannot unmarshal bool into field payload user type int
Guides/go json cannot unmarshal number into field user id type string
Guides/go json cannot unmarshal string into field user email type int
Guides/java jackson cannot deserialize java lang boolean from string 2026 02 1 d
Guides/csharp stj could not be converted system collections generic list1 syst f
Guides/csharp newtonsoft error converting false system guid value
Guides/csharp newtonsoft error converting 123 system int32 user id
Guides/go json cannot unmarshal bool into field token type string
Guides/python simplejson errors jsondecodeerror extra data line 1 column 2 char
Guides/csharp newtonsoft error converting null system timespan id
Guides/go json cannot unmarshal object into field user createdat type int
Guides/java jackson cannot deserialize instance java util linkedhashmap out of 9
Guides/java jackson cannot deserialize java lang integer from string true
Guides/node syntaxerror unexpected non whitespace character after json at positi
Guides/neighbor php java org yaml snakeyaml parser parserexception expected bloc
Guides/java jackson cannot deserialize java lang boolean from start object
Guides/csharp stj could not be converted system int64 user id
Guides/go json cannot unmarshal object into field payload items type string
Guides/csharp newtonsoft error converting 123 system guid user id
Guides/csharp newtonsoft error converting true system timespan value
Guides/ruby json parsererror 859 unexpected token at undefined
Guides/go json cannot unmarshal bool into map string interface
Guides/go json cannot unmarshal string into field meta count type int
Guides/csharp stj could not be converted system string createdat
Guides/php json decode state mismatch invalid or malformed json
Guides/csharp stj could not be converted system decimal payload
Guides/java jackson cannot deserialize java lang boolean from string false
Guides/csharp newtonsoft error converting null system timespan items 0 id
Guides/csharp stj could not be converted system int32 meta count
Guides/python yaml composer composererror found duplicate key
Guides/csharp newtonsoft error converting 123 45 system guid value
Guides/csharp newtonsoft error converting infinity system collections generic 4e
Guides/winner rust jsonwebtoken jwt signature is required migrations webhooks
Guides/go json cannot unmarshal bool into field user id type int
Guides/go json cannot unmarshal string into field token type int64
Guides/winner compare rust python yaml scanner scannererror mapping values are n
Guides/csharp stj could not be converted system double createdat
Guides/go json cannot unmarshal object into field token type int
Guides/go json cannot unmarshal array into field user email type float64
Guides/java org yaml snakeyaml parser parserexception expected block end but f e
Guides/csharp newtonsoft error converting null system double id
Guides/kubernetes error converting yaml to json yaml line 2 mapping values are c
Guides/csharp newtonsoft error converting null system collections generic list d
Guides/csharp stj could not be converted system guid items 0 id
Guides/go json cannot unmarshal string into field payload items type string
Guides/java org yaml snakeyaml parser parserexception while parsing a block mapp
Guides/java jackson cannot deserialize instance java lang string out of start ob
Guides/csharp stj could not be converted system string token
Guides/go invalid character closing bracket after top level value
Guides/pyjwt invalidsignatureerror signature verification failed
Guides/python yaml scanner scannererror mapping values are not allowed here
Guides/java jackson cannot deserialize instance java lang integer out of start a
Guides/csharp newtonsoft error converting infinity system int32 user id
Guides/java jackson cannot deserialize java time localdatetime from string 1 23
Guides/go json cannot unmarshal number into field user email type string
Guides/csharp newtonsoft error converting null system datetime value
Guides/java jackson cannot deserialize java time instant from string 1
Guides/go json cannot unmarshal array into field payload items type int
Guides/go json cannot unmarshal string into field token type string
Guides/java jackson cannot deserialize java lang boolean from start array
Guides/go json cannot unmarshal array into field user email type int64
Guides/python yaml reader readererror unacceptable character x0000
Guides/java jackson cannot deserialize instance java lang integer out of start o
Guides/node syntaxerror bad control character in string literal in json at posit
Guides/node syntaxerror unexpected string in json at position 10
Guides/csharp newtonsoft error converting 123 45 system decimal value
Guides/go json cannot unmarshal string into field user email type time time
Guides/csharp newtonsoft error converting null system decimal items 0 id
Guides/go json cannot unmarshal array into field payload user type string
Guides/go json cannot unmarshal number into field payload user type int
Guides/go json cannot unmarshal object into field payload items type time time
Guides/csharp stj could not be converted system string status
Guides/csharp newtonsoft error converting null system net ipaddress value
Guides/csharp newtonsoft error converting null system net ipaddress user id
Guides/go json cannot unmarshal bool into field user email type bool
Guides/winner rust jsonwebtoken jwt signature is required comparisons api gatewa
Guides/csharp newtonsoft error converting infinity system timespan id
Guides/csharp newtonsoft error converting true system uri value
Guides/go json cannot unmarshal string into field payload items type bool
Guides/csharp newtonsoft error converting false system collections generic lis 5
Guides/csharp stj could not be converted system timespan value
Guides/csharp stj could not be converted system guid payload
Guides/csharp newtonsoft error converting true system boolean items 0 id
Guides/csharp stj could not be converted system collections generic list1 syst e
Guides/winner live 1 base64url vs base64 api responses reliability
Guides/java jackson cannot deserialize java time instant from string 1 23
Guides/neighbor csharp python yaml scanner scannererror mapping values are not a
Guides/csharp newtonsoft error converting 123 system decimal items 0 id
Guides/ruby json parsererror 783 unexpected token at infinity
Guides/go json cannot unmarshal array into field user id type float64
Guides/java jackson cannot deserialize java time localdatetime from string false
Guides/csharp stj could not be converted system collections generic list1 syst 8
Guides/winner php xml reference to entity must end with semicolon migrations aut
Guides/csharp newtonsoft error converting true system int64 value
Guides/go json cannot unmarshal bool into field meta count type int
Guides/csharp stj could not be converted system timespan status
Guides/go json cannot unmarshal string into field payload user type string
Guides/csharp stj could not be converted system decimal data
Guides/go json cannot unmarshal string into field user createdat type int64
Guides/winner java xml reference to entity must end with semicolon migrations we
Guides/csharp newtonsoft error converting 2026 02 17 system int32 items 0 id
Guides/go json cannot unmarshal number into field user createdat type bool
Guides/winner live 1 base64url vs base64 support cases troubleshooting
Guides/csharp newtonsoft error converting nan system datetime id
Guides/csharp newtonsoft error converting 2026 02 17 system guid value
Guides/go json cannot unmarshal number into field payload items type int
Guides/go json cannot unmarshal number into field token type time time
Guides/csharp newtonsoft error converting true system net ipaddress value
Guides/java jackson cannot deserialize java util map from start array
Guides/go json cannot unmarshal array into field user id type string
Guides/go json cannot unmarshal bool into field user email type float64
Guides/go json cannot unmarshal number into field token type string
Guides/java jackson cannot deserialize java time localdatetime from string null
Guides/python simplejson errors jsondecodeerror expecting delimiter line 1 col 6
Guides/csharp stj could not be converted system int64 user email
Guides/bridge benchmarks csv header normalization node checklists api gateway
Guides/neighbor python python yaml scanner scannererror mapping values are not a
Guides/winner compare go jsonwebtoken jwt signature is required compatibility in
Guides/csharp newtonsoft error converting infinity system timespan user id
Guides/go json cannot unmarshal string into field payload user type bool
Guides/go json cannot unmarshal string into field user createdat type time time
Guides/csharp stj could not be converted system boolean payload
Guides/python jsondecodeerror expecting value line 1 column 1 char 0
Guides/csharp newtonsoft error converting 2026 02 17 system boolean id
Guides/winner rust base64url vs base64 alternatives sdk integration
Guides/java jjwt signatureexception signature does not match
Guides/go json cannot unmarshal string into field payload user type time time
Guides/go json cannot unmarshal string into field user createdat type string
Guides/winner csharp base64url vs base64 alternatives auth flow
Guides/winner csharp csharp newtonsoft error converting null system datetime val
Guides/csharp newtonsoft error converting nan system uri user id
Guides/python lxml xmlsyntaxerror extra content at end of document
Guides/csharp newtonsoft error converting true system net ipaddress id
Guides/go json cannot unmarshal string into field user createdat type float64
Guides/java jackson cannot deserialize java util linkedhashmap from start object
Guides/csharp newtonsoft error converting 123 system decimal value
Guides/csharp newtonsoft error converting infinity system int32 items 0 id
Guides/csharp stj could not be converted system int32 user email
Guides/csharp newtonsoft error converting 123 system int64 items 0 id
Guides/csharp newtonsoft error converting nan system datetime user id
Guides/go json cannot unmarshal array into field user createdat type time time
Guides/go json cannot unmarshal bool into field meta count type int64
Guides/java jackson cannot deserialize java lang boolean from string 1 23
Guides/csharp newtonsoft error converting 2026 02 17 system guid items 0 id
Guides/go json cannot unmarshal number into field user email type int
Guides/go json cannot unmarshal string into field user createdat type bool
Guides/csharp newtonsoft additional text after finished reading json content p f
Guides/winner live 1 base64url vs base64 webhooks performance
Guides/csharp newtonsoft error converting false system datetime value
Guides/csharp newtonsoft error converting false system int64 items 0 id
Guides/go json cannot unmarshal array into field payload items type float64
Guides/winner compare php jsonwebtoken jwt signature is required performance inc
Guides/csharp stj could not be converted system string user id
Guides/java jackson cannot deserialize java lang integer from string 1 23
Next pages to check
Closest crawled pages without impressions yet. Added to speed first-impression conversion.
Quick fix checklist
- Reproduce the error on a minimal input.
- Check type/format and field mapping.
- Apply the smallest safe fix.
- Validate on production-like payload.
Related by intent
Useful follow-up pages selected from real search impressions and no-click opportunities.
Related by winning cluster
Linked from a winner family to push crawl and first-impression conversion.