JWT signature size by algorithm identifier in octets
Engineers who size tokens or check header and cookie limits need one number per algorithm: the signature length in octets. Under RFC 7518, an ES256 signature is 64 octets and an Ed25519 signature is 64 octets, while an RS256 signature equals the RSA modulus length, which is 256 octets at a 2048-bit key. The RSA length rule comes from RFC 8017. This table is for developers who set token lifetimes and claim sizes, platform teams who configure gateways and proxies with header size limits, and security reviewers who check whether a chosen algorithm fits those limits. It is also the first place to look when a token grows after a key change.
The table covers every JWS algorithm identifier that RFC 7518 defines: HS256, HS384 and HS512, the RS and PS families at each hash size, and the ES identifiers on the P-256, P-384 and P-521 curves. ES384 gives 96 octets and ES512 gives 132 octets, because each signature is a fixed-length concatenation of R and S. Ed25519 and Ed448 use the EdDSA identifier defined in RFC 8037, and their sizes come from RFC 8032, which gives 64 octets for Ed25519 and 114 octets for Ed448. For RSA, the RFC 7518 minimum of 2048 bits applies to RS and PS keys, and a 3072-bit key gives 384 octets while a 4096-bit key gives 512 octets. HS256 has no signature size larger than its 32-octet output, so it stays smallest for symmetric deployments.
Size is only part of the cost. The compact serialization in RFC 7515 encodes the signature in base64url, so the encoded length is larger than the raw octet count, and the reader should measure the encoded token in their own environment before setting limits. Confirm the header and cookie limits of each proxy, load balancer and browser in the path, and confirm the key sizes and identifiers each client library accepts, since support for PS and EdDSA identifiers varies by library version.
JWS algorithm identifiers and signature sizes in octets
This table lists each JWS algorithm identifier with its underlying algorithm, the key size or length the sources require, and the signature size in octets. Read the signature size as the length of the value in the third segment of a compact JWS, before Base64url encoding, and check the RFC source column for the section that defines each figure. The main takeaway is that RSA-based and EdDSA signatures have fixed lengths tied directly to key size, while HMAC signatures depend only on the hash output.
| Identifier | Underlying algorithm | Key size or length | Signature size (octets) | RFC source |
|---|---|---|---|---|
| HS256 | HMAC with SHA-256 | 256 bits or larger | Not stated in the sources | RFC 7518, Section 3.2 |
| HS384 | HMAC with SHA-384 | Not stated in the sources | Not stated in the sources | RFC 7518, Section 3.1 |
| HS512 | HMAC with SHA-512 | Not stated in the sources | Not stated in the sources | RFC 7518, Section 3.1 |
| RS256 | RSASSA-PKCS1-v1_5 with SHA-256 | 2048 bits or larger | 256 for a 2048-bit modulus | RFC 7518, Section 3.3; RFC 8017, Section 8.2.1 |
| RS384 | RSASSA-PKCS1-v1_5 with SHA-384 | 2048 bits or larger | 256 for a 2048-bit modulus | RFC 7518, Section 3.3; RFC 8017, Section 8.2.1 |
| RS512 | RSASSA-PKCS1-v1_5 with SHA-512 | 2048 bits or larger | 256 for a 2048-bit modulus | RFC 7518, Section 3.3; RFC 8017, Section 8.2.1 |
| PS256 | RSASSA-PSS with SHA-256 and MGF1 | 2048 bits or larger | 256 for a 2048-bit modulus | RFC 7518, Section 3.5; RFC 8017, Section 8.1.1 |
| PS384 | RSASSA-PSS with SHA-384 and MGF1 | 2048 bits or larger | 256 for a 2048-bit modulus | RFC 7518, Section 3.5; RFC 8017, Section 8.1.1 |
| PS512 | RSASSA-PSS with SHA-512 and MGF1 | 2048 bits or larger | 256 for a 2048-bit modulus | RFC 7518, Section 3.5; RFC 8017, Section 8.1.1 |
| ES256 | ECDSA with P-256 and SHA-256 | P-256 curve | 64 | RFC 7518, Section 3.4 |
| ES384 | ECDSA with P-384 and SHA-384 | P-384 curve | 96 | RFC 7518, Section 3.4 |
| ES512 | ECDSA with P-521 and SHA-512 | P-521 curve, R and S 521 bits each | 132 | RFC 7518, Section 3.4 |
| EdDSA (Ed25519) | EdDSA on Ed25519 | 32-octet public key | 64 (R 32 octets, S 32 octets) | RFC 8037, Section 3.1; RFC 8032, Sections 5.1.5 and 5.1.6 |
| EdDSA (Ed448) | EdDSA on Ed448 | 57-octet public key | 114 (R 57 octets, S 57 octets) | RFC 8037, Section 3.1; RFC 8032, Sections 5.2.5 and 5.2.6 |
How to read the signature size columns
This section explains what each size column on the page reports and why the numbers differ by algorithm identifier. A JWT signature is the third segment of the JWS Compact Serialization, which RFC 7515 Section 3.1 defines as three Base64url-encoded parts joined by periods. The signature column gives the length of the raw signature octets before Base64url encoding. Base64url adds roughly a third more characters to the token, so an engineer sizing a header or cookie should multiply the raw length by the encoding overhead, not read the raw figure as the on-wire figure. The sizes are fixed by the algorithm and key, not by the token payload, which means the signature cost of a token is predictable once the identifier and key are chosen.
For the RS and PS identifiers, the signature length is the length in octets of the RSA modulus, as RFC 8017 Sections 8.1.1 and 8.2.1 specify. A 2048-bit key therefore gives a 256-octet signature for RS256, RS384, RS512, PS256, PS384 and PS512 alike, and the three hash choices within each family do not change the signature length. RFC 7518 Sections 3.3 and 3.5 require keys of 2048 bits or larger for these identifiers, so the size column reflects the minimum permitted key, and larger keys raise the figure in step with the modulus. Confirm the key length your issuer actually generates, since that value, not the table minimum, sets the size you will see in production.
For the ES identifiers, RFC 7518 Section 3.4 defines the signature as the fixed-length concatenation of R and S, so the size depends only on the curve: 64 octets for ES256, 96 for ES384 and 132 for ES512. For EdDSA, the signature sizes come from RFC 8032 Sections 5.1.6 and 5.2.6 because RFC 8037 registers the identifier but states no size. Ed25519 yields 64 octets and Ed448 yields 114 octets. The labels in the requirement column come from RFC 7518 Section 3.1: HS256 is Required, RS256 and ES256 are Recommended, and the remaining identifiers are Optional. Read these as implementation guidance in the RFC, not as a statement about what your deployment must support.
Where JWT signature size affects the token
The signature is the largest part of a compact JWS, and its length depends on the algorithm identifier and the key behind it. The cards below cover the places where that length changes what a deployment has to handle: the final token size, the encoding overhead, the single-signature format, and the key size floors that RSA and PS identifiers impose.
Total token length in headers and cookies
A compact JWS is three Base64url segments joined by periods, so the signature length adds directly to the size of the token. Tokens are often sent in the Authorization header or stored in cookies, and both carry their own size limits set by servers, proxies and browsers. Before choosing an algorithm, add the header, the payload and the expanded signature to get the full token length, then check that total against the limits of every component the token passes through. The sources listed here do not give those component limits, so confirm them in each system's own documentation.
Base64url expansion of the signature
The signature is encoded with Base64url, which uses the URL-safe alphabet of RFC 4648 Section 5, omits trailing '=' characters and contains no line breaks or whitespace. The encoded segment is therefore longer than the raw signature octets, and the encoded length is the figure that ends up in the token. Use the raw signature length from the table as the input, then apply the Base64url encoding rules in RFC 7515 Section 2 to get the length of the third segment.
RFC 7515 textSingle signature in compact serialization
The Compact Serialization supports only one signature or MAC and has no syntax for a JWS Unprotected Header, as RFC 7515 Section 7.1 states. Tokens that need more than one signature cannot use this form and must use the JSON Serialization instead, which has a different structure and a different total size. Check which serialization your token issuer and consumers support before assuming that one signature length applies to the whole token.
RFC 7515 textMinimum key sizes for RSA identifiers
RFC 7518 requires a key of 2048 bits or larger for RS256, RS384, RS512, PS256, PS384 and PS512, as Sections 3.3 and 3.5 state. That floor sets the minimum signature length for these identifiers at 256 octets, because the RSA signature length equals the modulus length in octets. Larger keys raise the signature length, so the key size chosen for an RSA or PS identifier controls the token size directly.
RFC 7518 textMinimum key size for HS256
RFC 7518 Section 3.2 requires an HS256 key of at least the hash output size, which is 256 bits. HMAC signatures are short, so this identifier keeps the signature segment small, but the same key is shared by the issuer and every verifier. Confirm where the shared key is stored and who holds it, because the sources listed here set the length rule and do not address key distribution.
RFC 7518 textSignature sizes for HMAC, RSA, ECDSA and EdDSA identifiers
The HMAC identifiers HS256, HS384 and HS512 use a shared secret rather than a public key pair. RFC 7518 Section 3.1 marks HS256 as Required, which makes it the one identifier every implementation must support. The signature length follows the hash output size, so the signature is the size of the hash that the identifier names.
- HS256: HMAC with SHA-256, Required in RFC 7518 Section 3.1. RFC 7518 Section 3.2 requires a key of at least 256 bits for this identifier.
- HS384: HMAC with SHA-384, Optional in RFC 7518 Section 3.1.
- HS512: HMAC with SHA-512, Optional in RFC 7518 Section 3.1.
- Key storage: The shared secret must exist on every party that verifies the token, so the key distribution model is a security concern, not only a size concern.
- Status: The RFC 7518 Section 3.1 status is the only status these identifiers carry, and it sets the baseline that interoperating services can assume.
Confirm the signature length for each hash output size against RFC 7518 and the HMAC definition in the sources before you put it in a token budget, and check that your verifier accepts the identifiers you issue.
The RSA identifiers come in two families. RS256, RS384 and RS512 use RSASSA-PKCS1-v1_5, and PS256, PS384 and PS512 use RSASSA-PSS with MGF1. In both, the signature is as long as the RSA modulus in octets, so the modulus length sets the signature size, not the hash.
- Signature length: A 2048-bit modulus gives a 256-octet signature, a 3072-bit modulus gives 384 octets and a 4096-bit modulus gives 512 octets, per RFC 8017 Sections 8.1.1 and 8.2.1.
- Key size floor: RFC 7518 Sections 3.3 and 3.5 require a key of 2048 bits or larger for all six identifiers.
- Status: RS256 is Recommended in RFC 7518 Section 3.1. RS384, RS512, PS256, PS384 and PS512 are Optional.
- Encoding overhead: Base64url encoding adds about a third to the signature length in the token, as defined in RFC 7515 Section 2.
- Choice of padding: The sources define both padding schemes, but they do not rank them for your environment. Check the padding your verifiers support.
Read the modulus length from your key, not from the identifier name, because the identifier does not fix the key size. Confirm the padding and modulus against RFC 8017 and RFC 7518.
The ECDSA identifiers ES256, ES384 and ES512 pair each hash with a NIST curve. In JWS the signature is the fixed-length concatenation of R and S, so the length depends on the curve and not on a variable-length DER encoding. RFC 7518 Section 3.1 marks ES256 as Recommended+, and the other two are Optional.
- ES256: P-256 with SHA-256, a 64-octet signature (RFC 7518, Section 3.4).
- ES384: P-384 with SHA-384, a 96-octet signature (RFC 7518, Section 3.4).
- ES512: P-521 with SHA-512, a 132-octet signature, with R and S each 521 bits (RFC 7518, Section 3.4).
- Status: ES256 is Recommended+ in RFC 7518 Section 3.1. ES384 and ES512 are Optional.
- Key size: The public key size follows the curve, and the sources give the signature sizes above without a separate public key table here.
The ES512 identifier names the SHA-512 hash, but the curve is P-521, so do not infer the curve from the hash name. Check the curve in your key material and confirm the signature length against RFC 7518 Section 3.4.
EdDSA is the JWS algorithm value registered by RFC 8037, with the curve set by the crv parameter, either Ed25519 or Ed448. RFC 8037 does not state a signature size, so the figures below come from RFC 8032. The status of EdDSA in RFC 7518 is not the same as the RSA and ECDSA statuses, so check the RFC 8037 text for its registration before you rely on it.
- Ed25519: A 32-octet public key and a 64-octet signature, made of R (32 octets) and S (32 octets), per RFC 8032 Sections 5.1.5 and 5.1.6.
- Ed448: A 57-octet public key and a 114-octet signature, made of R (57 octets) and S (57 octets), per RFC 8032 Sections 5.2.5 and 5.2.6.
- Registration: RFC 8037 Section 3.1 registers the "EdDSA" alg value with the Ed25519 and Ed448 crv values.
- Interoperability: Confirm that your libraries support the crv values you issue, because support varies by implementation.
Read the signature length from the curve, since the identifier alone does not give the length. Verify the figures against RFC 8032 and RFC 8037 before you use them in a token budget.
Check the signature size for your token before rollout
This sequence confirms which JWS algorithm identifier your issuer and verifier share, works out the encoded token length and the key size each identifier requires, and checks the header and cookie limits in your stack. It ends with a documented, library-confirmed list of identifiers you can roll out. The sources listed on this page cover the sizes and minimums, so each step names the document to check against.
Confirm the algorithm identifier on both sides
Record the value of the "alg" parameter that your token issuer writes into the JWS protected header and the value your verifier expects. Both must match exactly, and the identifiers are case-sensitive strings such as HS256, RS256, ES256, PS256 or EdDSA. Check the identifier list in Section 3.1 of RFC 7518 so you know which identifiers are defined. Treat "none" as a value to reject, since it means the token is unsigned. The step is done when issuer and verifier configurations name the same identifier for each client.
Determine the signature length for each identifier
For RS256, RS384, RS512, PS256, PS384 and PS512, the signature is the length of the RSA modulus in octets, so a 2048-bit key produces a 256-octet signature (RFC 8017, Sections 8.1.1 and 8.2.1). For ES256, ES384 and ES512, the signature is the fixed-length concatenation of R and S, giving 64, 96 and 132 octets (RFC 7518, Section 3.4). Ed25519 signatures are 64 octets and Ed448 signatures are 114 octets (RFC 8032, Sections 5.1.6 and 5.2.6). Write the value for each identifier you plan to use in a table, since you will need it in the next step.
Compute the encoded token length with Base64url
The Compact Serialization joins three Base64url parts with periods: the protected header, the payload and the signature (RFC 7515, Section 3.1). Base64url uses the URL-safe alphabet from RFC 4648 Section 5, omits trailing "=" characters and contains no whitespace (RFC 7515, Section 2). Encode each part's length by applying the Base64url rule to its octet count, then add the two periods. Do the calculation for your largest payload and each algorithm you plan to use, and record the total. The step is done when you have one total token length per identifier.
Confirm the key size meets the RFC 7518 minimum
Check each key against the minimums in RFC 7518. RS256, RS384, RS512, PS256, PS384 and PS512 require a key of 2048 bits or larger (RFC 7518, Sections 3.3 and 3.5). HS256 requires a key of at least 256 bits, which matches the hash output size (RFC 7518, Section 3.2). For ECDSA, confirm that the curve matches the identifier: P-256 for ES256, P-384 for ES384 and P-521 for ES512 (RFC 7518, Section 3.4). Record the key length from your key store and mark any key that falls below its minimum as a finding to fix before rollout.
Check header and cookie limits in your stack
Compare the total token length from the earlier step against the size limits of each component that carries the token: the web server, reverse proxy, load balancer, API gateway and the browser cookie handling. Look up each product's configured maximum request header size in its own documentation, and confirm the value in your environment, because this page does not list those defaults. If a token is sent in a cookie, also check the per-cookie and per-domain limits that your browsers and proxies apply. The step is done when every component in the path has a documented limit that exceeds your largest token.
Ask your library or identity provider which identifiers it supports
Ask your JWT library and your identity provider for the list of signing algorithm identifiers they support in both signing and verification, and whether they accept "EdDSA" with the Ed25519 and Ed448 curves. RFC 8037 registers EdDSA for JWS, but support in a given library or provider is a separate question that the RFC does not answer. Request the version number of each component along with the answer, and record the reply. The step is done when you hold written confirmation from each library and provider for every identifier on your list.
Record the result and set the rollout list
Combine the results into one document that lists each identifier, its signature length in octets, the encoded token length for your largest payload, the key size and curve you will use, the header limit it must stay under, and the library or provider version that supports it. Mark any identifier that fails a check as excluded from rollout. Circulate the document to the security, platform and identity teams for sign-off. The step is done when the signed document names the identifiers approved for production.
What these sizes do not tell you about a token
The figures on this page are signature sizes only. They give the length of the JWS Signature segment for each algorithm identifier, measured in octets before Base64url encoding. They do not give the size of a whole token. A JWS Compact Serialization is BASE64URL(UTF8(JWS Protected Header)) || '.' || BASE64URL(JWS Payload) || '.' || BASE64URL(JWS Signature) (RFC 7515, Section 3.1), so the protected header and the payload add their own length, and Base64url encoding adds further overhead on top of the raw octets. A token with a large claim set or a long header can be far bigger than its signature, whatever algorithm signs it. Before you set a limit on header size, cookie size or URL length, measure a real token from your own issuer, with your own claims. Base64url in JWS also omits trailing '=' characters and contains no line breaks or whitespace (RFC 7515, Section 2), so the encoded length does not follow a simple multiplication of the raw octets.
The sources cited here do not give library defaults. The RFCs define which identifiers exist, what key lengths they require and how each signature is formed, but they do not say which algorithm a given library chooses when none is specified, which key sizes it generates by default or whether it emits a header that lists the algorithm explicitly. The figures also apply to the algorithms as specified in the cited RFCs (RFC 7518 for the JWS algorithms, RFC 8037 for EdDSA, and RFC 8017 and RFC 8032 for the underlying primitives). They say nothing about how a particular implementation encodes, pads or validates a signature. Confirm each identifier's behaviour in the version of the library you run, including whether it accepts the "none" identifier, which RFC 7518 lists but which is not a signing algorithm, and whether it enforces the minimum key lengths the RFC requires for RS256, PS256 and HS256.
Questions readers ask about JWT signature sizes
How big is an ES256 signature in bytes?
An ES256 signature is 64 octets. ES256 uses ECDSA with the P-256 curve and SHA-256, and in a JWS the signature is the fixed-length concatenation of R and S, with each value taking 32 octets. Because the length is fixed, the signature does not grow with the payload. After base64url encoding, the signature segment of the compact token is 86 characters long, since base64url of 64 octets without padding yields 86 characters. The signature is one of three parts of the compact serialization, so the full token also carries the protected header and the payload. Confirm the figure against RFC 7518, Section 3.4 for the version of your JWT library, since some libraries emit DER-encoded ECDSA signatures and those are not the same length.
How big is an RS256 signature and how does key length change it?
An RS256 signature is the length of the RSA modulus in octets. A 2048-bit key gives a 256-octet signature, a 3072-bit key gives 384 octets and a 4096-bit key gives 512 octets, following RFC 8017, Sections 8.1.1 and 8.2.1. RFC 7518 requires a key of at least 2048 bits for RS256. The signature length therefore scales directly with key size: doubling the modulus length doubles the signature octets. Base64url encoding adds about one third more characters, so a 256-octet signature becomes roughly 342 characters in the token. The same length rule applies to RS384 and RS512, which use the same key sizes. Check the key length your issuer uses, because a larger key increases token size on every request that carries it.
How large is an Ed25519 signature?
An Ed25519 signature is 64 octets. RFC 8032, Sections 5.1.5 and 5.1.6, define it as R (32 octets) followed by S (32 octets). RFC 8037 registers the JWS algorithm value EdDSA with the Ed25519 curve but does not state a signature size itself, so the 64-octet figure comes from RFC 8032. The public key is 32 octets. Because the signature length is fixed, an Ed25519-signed token has the same signature length as an ES256 token, which is 64 octets, although the two algorithms differ in key size and interoperability support across libraries. Confirm that your JWT library supports the EdDSA value before relying on it, since support varies by implementation.
Does HS256 have a signature size?
HS256 produces a MAC rather than a public-key signature, and its output is the HMAC-SHA-256 value, which is 32 octets. RFC 7518, Section 3.2, requires an HS256 key of at least 256 bits, matching the hash output size. Because HS256 uses one shared secret for both signing and verification, any party that can verify a token can also forge one, so it fits deployments where the issuer and the verifier are the same trust domain. The 32-octet MAC encodes to 43 characters in base64url. HS256 is the required algorithm in RFC 7518 Section 3.1, which means every JWT implementation is expected to support it. Choose it only when the shared-secret trust model matches your architecture.
Do these signature sizes fit inside a cookie or HTTP header?
Whether a token fits depends on the whole token, not the signature alone. The JWS compact serialization joins three base64url segments with periods, so the signature is one part of the total length. Using the RFC figures, an ES256 token adds about 86 characters for the signature and an RS256 token with a 2048-bit key adds about 342 characters, while an HS256 token adds about 43 characters. The header and payload often dominate the size, especially when claims grow. The sources cited here do not set a maximum cookie or header size, so check the limits of your browsers, proxies and servers, and keep token payloads small when the token travels in a cookie. Test the complete token in your own environment before you commit to a format.
What does the compact serialization require of the signature segment?
The compact serialization joins three base64url segments with periods: the protected header, the payload and the signature. RFC 7515, Section 3.1, defines this structure. Base64url uses the URL-safe alphabet from RFC 4648 Section 5, omits trailing equals signs and contains no whitespace or line breaks, as RFC 7515, Section 2, specifies. The compact form supports one signature or MAC only, with no syntax for an unprotected header, as RFC 7515, Section 7.1, states. Engineers who parse tokens should therefore expect exactly three segments and should reject tokens that contain whitespace or padding characters. Verify parsing behavior against the library you deploy.
Which JWS algorithm should I check first when sizing tokens?
Start with the algorithm your issuer actually signs with, because the signature length depends on it. Per RFC 7518, Section 3.1, HS256 is required, RS256 and ES256 are recommended and the other identifiers are optional, so many deployments will use one of those three. The sizes from the RFC figures are 32 octets for HS256, 256 octets for RS256 with a 2048-bit key and 64 octets for ES256, with Ed25519 at 64 octets under RFC 8032. Record the algorithm, key size and curve in your inventory, then calculate token size from your own header and payload. Confirm the identifier list against the RFC version your library claims to implement.
Where the signature sits in a compact JWS
A compact JWS is built by joining three parts with dots. The process starts with the JWS Protected Header, which is UTF-8 encoded and then Base64url encoded. The JWS Payload is Base64url encoded next, and the JWS Signature is computed over the first two parts and Base64url encoded last. The result is one string with two dots, which travels in a request header. Check that each part is Base64url encoded without trailing = characters, since the signature length you measure depends on the encoded third segment (RFC 7515, Section 3.1).
The three Base64url parts joined by dots form one compact JWS token.
How DeployOpen works on JWT signature sizes by algorithm identifier
DeployOpen works on JWT signature sizes by algorithm identifier as a fixed-scope engagement inside your own infrastructure. We start from the algorithm identifiers your services actually issue and verify, then document the size each one produces so your token and header budgets can be checked against real configuration.
How we scope
- We list which JWS algorithm identifiers your issuers and verifiers currently accept, including whether "none" is enabled.
- We record the key sizes in use, such as RSA modulus length or EC curve, since these determine signature length.
- We agree the scope, deliverables and timeline in writing before any work starts, with no prices shown here.
How we build
- We configure token issuance and verification to the agreed identifiers, keeping the algorithm allowlist explicit.
- We measure encoded token length, including Base64url expansion, for each identifier in your environment.
- We test token handling with representative claim sets to confirm header and payload size stay within your limits.
How we hand over
- We deliver a table of signature lengths and encoded token overhead for each identifier you run.
- We document the configuration, key sizes and verifier settings so your team can review and reproduce them.
- We walk your engineers through the results and flag any identifier that needs a decision before rollout.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer if token formats change.
- We re-run the size checks when you add an algorithm identifier or change a key size.
- Confirm compatibility of any identifier with your specific library and version before relying on it in production.
Sources and further reading
- RFC 7518: JSON Web Algorithms (JWA) ↗
- RFC 7515: JSON Web Signature (JWS) ↗
- RFC 8017: PKCS #1, RSA Cryptography Specifications Version 2.2 ↗
- RFC 8032: Edwards-Curve Digital Signature Algorithm (EdDSA) ↗
- RFC 8037: CFRG Elliptic Curve Diffie-Hellman and Signatures in JOSE ↗
- Federal Register notice for FIPS 186-5 ↗

