---
title: "decode · RUAL Documentation"
description: "Decodes the given json web token and returns the payload. Unverified JWTs should be treated with caution and viewed the same as other user input"
canonical: https://docs.rual.nl/block-types/json%20web%20token/function_jwt_decode
language: en
---

[Cluster](https://docs.rual.nl/cluster)

[Blocks](https://docs.rual.nl/block-types)

[Interfaces](https://docs.rual.nl/interfaces)

[Blueprints](https://docs.rual.nl/blueprints)

[Tutorials](https://docs.rual.nl/tutorials)

[Home automation](https://docs.rual.nl/home-automation)

[Examples](https://docs.rual.nl/examples)

[Reference](https://docs.rual.nl/reference)

[Architecture](https://docs.rual.nl/architecture)

[Troubleshooting](https://docs.rual.nl/troubleshooting)

Other

# decode

This block is part of the [`json web token`](https://docs.rual.nl/block-types/json%20web%20token) group and was last modified in core [`v13.0.8`](https://docs.rual.nl/core-versions/130008).

Decodes the given json web token and returns the payload. Unverified JWTs should be treated with caution and viewed the same as other user input

- flow `flow`

- token required `value` the token to be decoded

- flow `flow`

- success `condition`

- error `value`

- verified `condition` to verify the token please use jwt verify

- payload `object`

Decodes the JWT payload WITHOUT verifying the signature; verified is always false (use jwt verify for that). Only an empty token fails, with error MISSING_TOKEN and success=false : a malformed token (fewer than 2 segments, bad base64, or non-JSON payload) still reports success=true with payload=nil. Example: token="abc" -> success=true, payload=nil.

| `jwt` |
| --- |

A typical wiring for [decode](https://docs.rual.nl/block-types/json%2520web%2520token/function_jwt_decode): a [function trigger](https://docs.rual.nl/block-types/globals/trigger_custom_function) starts the flow; [value](https://docs.rual.nl/block-types/value/value_default) feeds the `token` pin; the `flow` out pin feeds [debug](https://docs.rual.nl/block-types/state%2520ui/state_debug).

[![Studio canvas example for the decode block: typical wiring for decode.](https://docs.rual.nl/canvas-examples/function_jwt_decode.png)](https://docs.rual.nl/canvas-examples/function_jwt_decode.png?v=3)

## Version history

Introduced in [`v13.0.8`](https://docs.rual.nl/core-versions/130008).

- [Back to `json web token`](https://docs.rual.nl/block-types/json%20web%20token): Return to the main group to view all sub-groups

- [Back to `json web token`](https://docs.rual.nl/block-types/json%20web%20token?group=json%20web%20token): Return to the group to view all blocks within this group

Was this page helpful? [Tell us what to improve](https://docs.rual.nl/support) · RUAL Docs is an integral component of the [RUAL ecosystem](https://rual.nl)
