# Base64 Encoder/Decoder API

> Base64 Encoder/Decoder encodes plain text into Base64 and decodes encoded strings back to readable characters. Submit any string with an encode or decode action to receive the converted output, the original input, and character length.

**Endpoint:** `GET https://api.apiverve.com/v1/base64`  
**Category:** Data Conversion  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/base64

## Overview

A Base64 encode and decode API on a simple GET endpoint: pass your text as a query parameter. Because it works on any text, you can turn JSON to Base64 for a header or payload, or decode Base64 back to JSON. Base64 Encoder/Decoder works by converting text to Base64 encoding or decoding Base64 strings back to readable text. Returns the converted result along with length information.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/base64?text=Hello%20World&action=encode" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `text` | string | Yes | The text to encode |
| `action` | string | No | The action to perform. default encode. One of: encode, decode |

## Response fields

- `action` — string · The action performed on the text
- `original` — string · The original input text before encoding
- `encoded` — string · The Base64 encoded result of the input text
- `length` — number · Length of the original input text

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "action": "encode",
    "original": "Hello World",
    "encoded": "SGVsbG8gV29ybGQ=",
    "length": 16
  }
}
```

## Use cases

- **Data Transmission** — Encode binary data as Base64 for safe transmission over text-based protocols like email or HTTP
- **API Integration** — Encode credentials or sensitive data in Base64 format for API authentication headers
- **File Embedding** — Encode images or files as Base64 strings to embed them directly in HTML, CSS, or JSON
- **Data Storage** — Convert binary data to Base64 for storage in text-based databases or configuration files

## SDKs

- **npm** — `npm install @apiverve/base64` (https://www.npmjs.com/package/@apiverve/base64)
- **NuGet** — `dotnet add package APIVerve.API.Base64EncoderDecoder` (https://www.nuget.org/packages/APIVerve.API.Base64EncoderDecoder)
- **Source** — https://github.com/apiverve/base64-api

## More

- Full reference: https://docs.apiverve.com/ref/base64
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
