Free plan

Encode / decode

Change text into Base64, hex or other codes, or back again
POST
/v1/documents/encode

About this tool

This tool turns text or a file into another form, or turns it back. The forms include Base64, hex, web address codes, HTML codes, Morse and more. Base64 is a way to write any data using only letters and digits. It is a coding, not secret protection. It can also show what is inside a JWT, a type of login token.
For example, you turn a short text into Base64 so it can travel safely inside a link, then turn it back later.

How to use it

  1. Choose this tool.
  2. Type or paste your text, or add a file.
  3. Choose the code, such as Base64 or hex, and choose Encode or Decode.
  4. Press Generate.
  5. Copy the result or download it.

What you get back

You get the changed text on screen to copy, or a file to download. This is not encryption; anyone can reverse it.
GOOD TO KNOW
A JWT is only decoded, never verified. Counts as one document.
TEST IT LIVE

Try Encode / decode in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Documents
Plan
Free
Method
POST
Endpoint
/v1/documents/encode
Tool ID
documents.encode
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Documents
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/documents/encode" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'text=Hello, world' \
  -F 'scheme=base64' \
  -F 'action=encode'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.documents.encode({
    "text": "Hello, world",
    "scheme": "base64",
    "action": "encode"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->documents()->encode([
    'text' => 'Hello, world',
    'scheme' => 'base64',
    'action' => 'encode',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Encode or decode a text or a file: Base64, Base64URL, hex, URL, HTML entities, Punycode, quoted-printable, binary, Ascii85, ROT13, u escapes and Morse; or read the header and payload of a JWT.

Encode / decode works from text and settings, so no file is needed. Every input is optional.

Encode / decode is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/documents/encode with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.