# Data handling - TypeScript SDK

All data sent to and from the Temporal Service passes through the **Data Converter**. The Data Converter has three
layers that handle different concerns:

![The Flow of Data through a Data Converter](/diagrams/data-converter-flow-with-external-storage.svg)

Of these three layers, only the PayloadConverter is required. Temporal uses a default PayloadConverter that handles JSON
serialization. The PayloadCodec and ExternalStorage layers are optional. You only need to customize these layers when
your application requires non-JSON types, encryption, or payload offloading.

|                           | [PayloadConverter](/develop/typescript/best-practices/data-handling/data-conversion) | [PayloadCodec](/develop/typescript/best-practices/data-handling/data-encryption) |
| ------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------- |
| **Purpose**               | Serialize application data to bytes                               | Transform encoded payloads (encrypt, compress)                |
| **Default**               | JSON serialization                                                | None (passthrough)                                            |

For a deeper conceptual explanation, see the [Data Conversion encyclopedia](/dataconversion) and [External Storage](/external-storage).
