Payload Formatters

Payload formatters allow you to process data going to and from end devices. This is useful for converting binary payloads to human readable fields, or for doing any other kind of data conversion on uplinks and downlinks.

This section explains how to set up payload formatters for a specific end device or an entire application.

Types of Payload Formatters

The Things Stack supports three types of payload formatters: Javascript, CayenneLPP, and Repository payload formatters.


The Things Stack allows you to write your own custom payload formatters in Javascript. To find out how to write a custom Javascript payload formatter, see the Javascript Payload Formatters section.


The Things Stack can automatically decode CayenneLPP formatted payloads, no custom code neccessary. To find out how to use CayenneLPP payload formatters, see the CayenneLPP section.


Device manufacturers may submit payload formatters designed to work with their devices. These are publicly available in The Things Stack Device Repository.

Device repository payload formatters work right out of the box - no customization needed!

Application and Device Specific Payload Formatters

Payload formatters can be applied to an entire application, or to a specific end device. Application payload formatters are useful if all devices use the same binary payload format, or as a fallback when no device specific payload formatter is set.

Device payload formatters allow you to specify a unique payload formatter for each device.

Device payload formatters override application payload formatters.

Working with Bytes

To work with payload formatters, it is important to understand how payload data is encoded as binary bytes, and how to convert it to meaningful fields.

To see how your device encodes environmental data, see your product datasheet.

See The Things Network Learn for an introduction to working with bytes.