---
title: "Encode"
description: "Encode a value as JSON, Base64, Base64 URL, hex, or encrypt."
canonical_url: "https://docs.vettero.com/build/workflows/blocks/utility/encode"
---
# Encode

> Encode a value as JSON, Base64, Base64 URL, hex, or encrypt.

<block-meta block="Yes" channels="Any" folder="basic/utility" group="Utility" groupTo="/build/workflows/blocks/utility" icon="i-lucide-lock" pipe="Value" scope="Any" tool="No" type="utl.encode">



</block-meta>

**Encode** turns **Value** into text using **Encode type**. The result is written to the data pipe. Use [Decode](https://docs.vettero.com/build/workflows/blocks/utility/decode) for the reverse (including **Decrypt** for **Encrypt**).

## Configure

<table>
<thead>
  <tr>
    <th>
      Setting
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Value
      </strong>
    </td>
    
    <td>
      Literal or variable to encode (required)
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Encode type
      </strong>
    </td>
    
    <td>
      <strong>
        JSON
      </strong>
      
      , <strong>
        Base64
      </strong>
      
      , <strong>
        Base64 URL
      </strong>
      
      , <strong>
        Hex
      </strong>
      
      , or <strong>
        Encrypt
      </strong>
    </td>
  </tr>
</tbody>
</table>

## Handles

<table>
<thead>
  <tr>
    <th>
      Handle
    </th>
    
    <th>
      Role
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        In
      </strong>
      
       (target)
    </td>
    
    <td>
      Incoming connection
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Out
      </strong>
      
       (source)
    </td>
    
    <td>
      Continues after encoding
    </td>
  </tr>
</tbody>
</table>

## Pipe schema

The next block reads this on the data pipe (`pipe.value`). The value is `text`.

## Use case

- Base64-encode a token before an [API](https://docs.vettero.com/build/workflows/blocks/utility/api) header.
- JSON-encode an object to send as text.

<block-page-nav>



</block-page-nav>


## Sitemap

See the full [sitemap](https://docs.vettero.com/sitemap.md) for all pages.
