---
title: "Text to Binary"
method: POST
path: "/api/v1/tools/text-to-binary"
tags: ["tools"]
---

# Text to Binary

`POST /api/v1/tools/text-to-binary`

## Request

- Base URL: `https://toolforte.com`
- URL: `https://toolforte.com/api/v1/tools/text-to-binary`
- Auth: HTTP bearer

Turn text into its UTF-8 bytes written as binary, hexadecimal, octal and decimal, or read those numbers back into text. The unit is the byte, not the character, so an accented letter is two groups and an emoji four. Both directions return all four bases at once, and decoding rejects a value that is not a byte or a byte sequence that is not valid UTF-8.

## Request body

- object
  - `input` string
  - `action` string
  - `format` string
  - `separator` string

## Response `200`

Successful result

- object
  - `ok` boolean
  - `data` object
    - `text` string
    - `binary` string
    - `hex` string
    - `octal` string
    - `decimal` string
    - `characters` integer
    - `bytes` integer
    - `bits` integer

## Other responses

- `400`: Missing or invalid request fields
- `401`: Invalid or missing API key
- `429`: Monthly plan limit reached

---

[API](https://skmtc.dev/toolforte/apis/toolforte-api.md) · [All operations](https://skmtc.dev/toolforte/apis/toolforte-api/llms.txt) · [OpenAPI document](https://skmtc.dev/toolforte/apis/toolforte-api/revisions/4d814d484dfc?raw)
