Web CryptographyBaseline · Widely available
The Web Cryptography API performs low-level cryptographic operations, such as encryption, decryption, and signature verification. Also known as the Web Crypto API.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Sep 19, 2017. Widely available since Mar 19, 2020.
Browser support
DesktopChrome
1–36Not supported
37+Supportedsince Aug 26, 2014
Current: 155Edge
12+Supportedsince Jul 29, 2015
Current: 154Firefox
1–33Not supported
34+Supportedsince Dec 1, 2014
Current: 157Safari
1–10.1Not supported
11+Supportedsince Sep 19, 2017
Current: 27MobileChrome Android
18–36Not supported
37+Supportedsince Sep 3, 2014
Current: 155Firefox Android
4–33Not supported
34+Supportedsince Dec 1, 2014
Current: 157Safari iOS
1–10.3Not supported
11+Supportedsince Sep 19, 2017
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: Crypto.
Feature detection
JS · check before using
if ("Crypto" in globalThis) {
// Crypto is available
} else {
// load a polyfill or use a fallback
}Sub-features
Support for each part of the feature (41). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Crypto | 11 | 12 | 21 | 5 | 18 | 21 | 5 |
| Crypto.getRandomValues | 11 | 12 | 21 | 5 | 18 | 21 | 5 |
| Crypto.randomUUID | 92 | 92 | 95 | 15.4 | 92 | 95 | 15.4 |
| Crypto.subtle | 37 | 12 | 34 | 11 | 37 | 34 | 11 |
| Crypto.subtle.secure_context_required | 60 | 79 | 75 | 15 | 60 | 79 | 15 |
| CryptoKey | 37 | 12 | 34 | 10 | 37 | 34 | 9 |
| CryptoKey.algorithm | 37 | 12 | 34 | 10 | 37 | 34 | 9 |
| CryptoKey.extractable | 37 | 12 | 34 | 10 | 37 | 34 | 9 |
| CryptoKey.type | 37 | 12 | 34 | 10 | 37 | 34 | 9 |
| CryptoKey.usages | 37 | 12 | 34 | 10 | 37 | 34 | 9 |
| SubtleCrypto | 37 | 12 | 34 | 11 | 37 | 34 | 11 |
| SubtleCrypto.decrypt | 37 | 79 | 34 | 11 | 37 | 34 | 11 |
| SubtleCrypto.deriveBits | 41 | 79 | 34 | 11 | 41 | 34 | 11 |
| SubtleCrypto.deriveBits.x25519 | 133 | 133 | 130 | 17 | 133 | 130 | 17 |
| SubtleCrypto.deriveKey | 41 | 79 | 34 | 11 | 41 | 34 | 11 |
| SubtleCrypto.deriveKey.derivedKeyAlgorithm_option_aes | 41 | 79 | 34 | 11 | 41 | 34 | 11 |
| SubtleCrypto.deriveKey.derivedKeyAlgorithm_option_hkdf | 41 | 79 | 119 | 11 | 41 | 119 | 11 |
| SubtleCrypto.deriveKey.derivedKeyAlgorithm_option_hmac | 41 | 79 | 34 | 11 | 41 | 34 | 11 |
| SubtleCrypto.deriveKey.derivedKeyAlgorithm_option_pbkdf2 | 41 | 79 | 119 | 11 | 41 | 119 | 11 |
| SubtleCrypto.deriveKey.x25519 | 133 | 133 | 130 | 17 | 133 | 130 | 17 |
Show 21 more
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| SubtleCrypto.digest | 41 | 79 | 34 | 11 | 41 | 34 | 11 |
| SubtleCrypto.encrypt | 37 | 79 | 34 | 11 | 37 | 34 | 11 |
| SubtleCrypto.exportKey | 37 | 79 | 34 | 11 | 37 | 34 | 11 |
| SubtleCrypto.exportKey.ed25519 | 137 | 137 | 129 | 17 | 137 | 129 | 17 |
| SubtleCrypto.exportKey.x25519 | 133 | 133 | 130 | 17 | 133 | 130 | 17 |
| SubtleCrypto.generateKey | 37 | 79 | 34 | 11 | 37 | 34 | 11 |
| SubtleCrypto.generateKey.ed25519 | 137 | 137 | 129 | 17 | 137 | 129 | 17 |
| SubtleCrypto.generateKey.x25519 | 133 | 133 | 130 | 17 | 133 | 130 | 17 |
| SubtleCrypto.importKey | 37 | 79 | 34 | 11 | 37 | 34 | 11 |
| SubtleCrypto.importKey.ed25519 | 137 | 137 | 129 | 17 | 137 | 129 | 17 |
| SubtleCrypto.importKey.x25519 | 133 | 133 | 130 | 17 | 133 | 130 | 17 |
| SubtleCrypto.secure_context_required | 60 | 79 | 75 | 15 | 60 | 79 | 15 |
| SubtleCrypto.sign | 37 | 79 | 34 | 11 | 37 | 34 | 11 |
| SubtleCrypto.sign.ed25519 | 137 | 137 | 129 | 17 | 137 | 129 | 17 |
| SubtleCrypto.unwrapKey | 37 | 79 | 34 | 11 | 37 | 34 | 11 |
| SubtleCrypto.verify | 37 | 79 | 34 | 11 | 37 | 34 | 11 |
| SubtleCrypto.verify.ed25519 | 137 | 137 | 129 | 17 | 137 | 129 | 17 |
| SubtleCrypto.worker_support | 37 | 79 | 48 | 11 | 37 | 48 | 11 |
| SubtleCrypto.wrapKey | 37 | 79 | 34 | 11 | 37 | 34 | 11 |
| crypto | 37 | 12 | 1 | 5 | 37 | 4 | 5 |
| crypto.worker_support | 37 | 79 | 48 | 10.1 | 37 | 48 | 10.3 |