---
title: "Base64-encode text"
method: POST
path: "/base64-encode.php"
tags: ["encoding"]
---

# Base64-encode text

`POST /base64-encode.php`

## Request

- Base URL: `https://mate.tools/api/v1`
- URL: `https://mate.tools/api/v1/base64-encode.php`
- Auth: none declared

Encodes the supplied text as Base64. When `url_safe=true`, uses the RFC 4648 §5 URL-safe alphabet (`-` and `_` instead of `+` and `/`) with padding stripped.

## Request body

- object
  - `text` string, required
  - `url_safe` boolean

## Response `200`

Success

## Other responses

- `400`: Malformed request
- `413`: Request body or text exceeds 1 MB
- `429`: Rate limit exceeded (60/min, 600/hour per IP). Includes Retry-After header.

---

[API](https://skmtc.dev/mate/apis/mate-tools-api.md) · [All operations](https://skmtc.dev/mate/apis/mate-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mate/apis/mate-tools-api/revisions/874670b78962?raw)
