Utilities · sync
qr-toolkit
Encode, decode, and classify QR codes. SVG + PNG out.
Encode payload
About
qr-toolkit unifies QR generation and QR reading under a single endpoint. Set `mode: 'encode'` to generate — you get back the QR as both SVG (inline) and a PNG you can host or embed. Set `mode: 'decode'` to read — pass a base64 image and get back the encoded text plus a classification of what kind of payload it is (URL, WiFi credential, vCard, mailto, sms, geo, tel, or plain text).
For common payload kinds the response includes a structured `parsed` object — e.g. WiFi payloads return SSID + password + auth type; mailto payloads return to + subject + body; vCard payloads return the parsed field map.
Generator: `qrcode` (npm). Decoder: `jsqr` over a sharp-rasterised RGBA grid — works on JPEG / PNG / WebP / AVIF inputs.
{
"type": "object",
"required": [
"mode"
],
"oneOf": [
{
"properties": {
"mode": {
"const": "encode"
},
"text": {
"type": "string",
"maxLength": 2953,
"description": "Payload to encode."
},
"errorCorrection": {
"type": "string",
"enum": [
"L",
"M",
"Q",
"H"
],
"default": "M"
},
"margin": {
"type": "integer",
"minimum": 0,
"maximum": 16,
"default": 2
},
"scale": {
"type": "integer",
"minimum": 1,
"maximum": 32,
"default": 6
},
"darkColor": {
"type": "string",
"default": "#000000ff"
},
"lightColor": {
"type": "string",
"default": "#ffffffff"
}
},
"required": [
"mode",
"text"
]
},
{
"properties": {
"mode": {
"const": "decode"
},
"imageBase64": {
"type": "string",
"description": "Base64-encoded image bytes."
}
},
"required": [
"mode",
"imageBase64"
]
}
]
}These are descriptive previews. Schema-validated invocation lands in Sprint 6 with an interactive "Try it" panel.
Reviews (0)
No reviews yet — be the first to share your experience.