# Binary To/From File Converter

## Links

- Product page URL: https://www.agentpmt.com/marketplace/binary-to-from-file-converter
- Product markdown URL: https://www.agentpmt.com/marketplace/binary-to-from-file-converter?format=agent-md
- Product JSON URL: https://www.agentpmt.com/marketplace/binary-to-from-file-converter?format=agent-json

## Overview

- Product ID: 695c3605767df5adfd9bc86d
- Vendor: Apoth3osis
- Type: core utility
- Unit type: request
- Price: 1000 credits
- Categories: Data Storage & Persistence, Data Processing, File & Binary Operations
- Generated at: 2026-05-30T20:20:03.813Z

### Page Description

Versatile data transformation utility that enables seamless conversion between various binary encoding formats and file storage operations. This function supports six core conversion actions: base64-to-hex, hex-to-base64, base64-to-binary, binary-to-base64, file-to-base64, and base64-to-file. For encoding transformations, users simply provide an input string in the source format and receive the converted output along with metadata such as byte size. The file-based operations integrate with cloud storage, allowing users to either extract base64-encoded content from existing stored files or create new files from base64 data with customizable filenames, MIME types, and expiration periods ranging from one to seven days. The function handles files up to 10MB for inline base64 returns and automatically generates signed URLs for secure file access. With built-in validation for all encoding formats and budget-based access controls, the File Binary Converter provides a reliable foundation for any workflow requiring binary data manipulation or format interoperability.

### Agent Description

Convert between base64, hex, and binary. Upload base64 as file or extract base64 from stored files. Files up to 10MB.

## Details

### Details

Versatile data transformation utility that enables seamless conversion between various binary encoding formats and file storage operations. This function supports six core conversion actions: base64-to-hex, hex-to-base64, base64-to-binary, binary-to-base64, file-to-base64, and base64-to-file. For encoding transformations, users simply provide an input string in the source format and receive the converted output along with metadata such as byte size. The file-based operations integrate with cloud storage, allowing users to either extract base64-encoded content from existing stored files or create new files from base64 data with customizable filenames, MIME types, and expiration periods ranging from one to seven days. The function handles files up to 10MB for inline base64 returns and automatically generates signed URLs for secure file access. With built-in validation for all encoding formats and budget-based access controls, the File Binary Converter provides a reliable foundation for any workflow requiring binary data manipulation or format interoperability.

### Actions

- `base64_to_hex` (10 credits): Convert a base64-encoded string to hexadecimal representation.
- `hex_to_base64` (10 credits): Convert a hexadecimal string to base64 encoding.
- `base64_to_binary` (10 credits): Convert a base64-encoded string to a binary (0s and 1s) string representation.
- `binary_to_base64` (10 credits): Convert a binary string (0s and 1s) back to base64 encoding.
- `file_to_base64` (10 credits): Read a previously uploaded file from cloud storage and return its contents as a base64-encoded string. Maximum file size is 10MB.
- `base64_to_file` (10 credits): Decode a base64 string and save it as a file in cloud storage with a signed download URL.

### Use Cases

Encoding image or document uploads for API transmission in multi-agent pipelines, decoding base64 email attachments and converting them to downloadable files, analyzing binary file signatures by converting file headers to hexadecimal for format detection, preparing binary payloads for webhook integrations that require hex or base64 encoding, converting cryptographic hashes between hex and base64 for cross-system compatibility, extracting and re-encoding embedded binary assets from JSON or XML data feeds, building file export workflows that package generated content into downloadable cloud-stored files, debugging binary protocols by converting raw data to human-readable binary strings, migrating encoded data between systems with different encoding standards, creating temporary secure file links from base64 data for sharing in automated notification workflows

### Workflows Using This Tool

No public workflows currently reference this product.

### Related Content

No related content is currently linked to this product.

## Integration Details

### DynamicMCP

- Setup page URL: https://www.agentpmt.com/dynamic-mcp
- Claude setup guide: https://www.agentpmt.com/dynamic-mcp?platform=claude#videos
- ChatGPT setup guide: https://www.agentpmt.com/dynamic-mcp?platform=chatgpt#videos
- Cursor setup guide: https://www.agentpmt.com/dynamic-mcp?platform=cursor#videos
- Windsurf setup guide: https://www.agentpmt.com/dynamic-mcp?platform=windsurf#videos

Use the local router for command-based MCP clients. It forwards requests to `https://api.agentpmt.com/mcp` and does not execute tools locally.

```bash
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

### REST API

The live page renders cURL, Python, JavaScript, and Node.js examples. Logged-in users see those examples prefilled with their own API and budget credentials.

- Purchase endpoint: https://api.agentpmt.com/products/purchase
- Authorization format: `Bearer <base64(apiKey:budgetKey)>`

```bash
curl -X POST "https://api.agentpmt.com/products/purchase" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eW91ci1hcGkta2V5LWhlcmU6eW91ci1idWRnZXQta2V5LWhlcmU=" \
  -d '{
    "product_id": "695c3605767df5adfd9bc86d",
    "parameters": {
      "action": "base64_to_hex",
      "input": "example_input"
    }
  }'
```

### Autonomous Agents

Autonomous agents can access this tool through AgentAddress credit balances or direct x402 payments. Use the Autonomous Agent API reference for endpoint shapes after choosing the access pattern below.

- Autonomous Agent API reference URL: https://www.agentpmt.com/docs/api-reference/autonomous-agents
- Autonomous Agent API reference markdown URL: https://www.agentpmt.com/docs/api-reference/autonomous-agents?format=agent-md
- Credit-Based Access Using AgentAddress: https://www.agentpmt.com/docs/autonomous-agents/credit-based-tool-usage-with-agentaddress
- AgentAddress is preferred for persistent file access, stored platform state, and maximum tool use ability across repeated calls.
- Direct x402 is for independent one-off tool calls that do not require shared files or stored platform state.
- Direct x402 public payments: USDC on Base, Arbitrum, Optimism, Polygon, and Avalanche.

### Schema

#### Parameters

- Schema type: actions

```json
{
  "actions": {
    "base64_to_hex": {
      "description": "Convert a base64-encoded string to hexadecimal representation.",
      "properties": {
        "input": {
          "type": "string",
          "description": "Base64-encoded string to convert to hex.",
          "required": true
        }
      }
    },
    "hex_to_base64": {
      "description": "Convert a hexadecimal string to base64 encoding.",
      "properties": {
        "input": {
          "type": "string",
          "description": "Hexadecimal string to convert to base64 (even number of characters, 0-9 and a-f).",
          "required": true
        }
      }
    },
    "base64_to_binary": {
      "description": "Convert a base64-encoded string to a binary (0s and 1s) string representation.",
      "properties": {
        "input": {
          "type": "string",
          "description": "Base64-encoded string to convert to binary representation.",
          "required": true
        }
      }
    },
    "binary_to_base64": {
      "description": "Convert a binary string (0s and 1s) back to base64 encoding.",
      "properties": {
        "input": {
          "type": "string",
          "description": "Binary string of 0s and 1s (length must be a multiple of 8; spaces between bytes are allowed).",
          "required": true
        }
      }
    },
    "file_to_base64": {
      "description": "Read a previously uploaded file from cloud storage and return its contents as a base64-encoded string. Maximum file size is 10MB.",
      "properties": {
        "file_id": {
          "type": "string",
          "description": "File ID of the uploaded file to read.",
          "required": true
        }
      }
    },
    "base64_to_file": {
      "description": "Decode a base64 string and save it as a file in cloud storage with a signed download URL.",
      "properties": {
        "input": {
          "type": "string",
          "description": "Base64-encoded file content to decode and save.",
          "required": true
        },
        "filename": {
          "type": "string",
          "description": "Name for the created file (e.g., 'output.png').",
          "required": true
        },
        "content_type": {
          "type": "string",
          "description": "MIME type for the created file (e.g., 'image/png', 'application/pdf').",
          "required": false,
          "default": "application/octet-stream"
        },
        "expiration_days": {
          "type": "integer",
          "description": "Days until file expires (1-7).",
          "required": false,
          "default": 7,
          "minimum": 1,
          "maximum": 7
        },
        "store_file": {
          "type": "boolean",
          "description": "Store output as a file in cloud storage (recommended for file management access).",
          "required": false,
          "default": true
        }
      }
    }
  },
  "properties": {}
}
```

### Usage Instructions

# Binary To/From File Converter

Convert data between base64, hexadecimal, and binary string representations, and convert files to/from base64 encoding.

## Actions

### base64-to-hex
Convert a base64-encoded string to hexadecimal.

**Required fields:**
- `action`: `"base64-to-hex"`
- `input`: Base64-encoded string

**Example:**
```json
{
  "action": "base64-to-hex",
  "input": "SGVsbG8gV29ybGQ="
}
```
Returns: `{ "encoding": "hex", "hex": "48656c6c6f20576f726c64", "size_bytes": 11 }`

---

### hex-to-base64
Convert a hexadecimal string to base64 encoding.

**Required fields:**
- `action`: `"hex-to-base64"`
- `input`: Hexadecimal string (even number of characters, 0-9 and a-f)

**Example:**
```json
{
  "action": "hex-to-base64",
  "input": "48656c6c6f20576f726c64"
}
```
Returns: `{ "encoding": "base64", "base64": "SGVsbG8gV29ybGQ=", "size_bytes": 11 }`

---

### base64-to-binary
Convert a base64-encoded string to a binary (0s and 1s) string representation.

**Required fields:**
- `action`: `"base64-to-binary"`
- `input`: Base64-encoded string

**Example:**
```json
{
  "action": "base64-to-binary",
  "input": "SGk="
}
```
Returns: `{ "encoding": "binary", "binary": "01001000 01101001", "size_bytes": 2 }`

---

### binary-to-base64
Convert a binary string (0s and 1s) back to base64 encoding.

**Required fields:**
- `action`: `"binary-to-base64"`
- `input`: Binary string of 0s and 1s (length must be a multiple of 8; spaces between bytes are allowed)

**Example:**
```json
{
  "action": "binary-to-base64",
  "input": "01001000 01101001"
}
```
Returns: `{ "encoding": "base64", "base64": "SGk=", "size_bytes": 2 }`

---

### file-to-base64
Read a previously uploaded file and return its contents as a base64-encoded string.

**Required fields:**
- `action`: `"file-to-base64"`
- `file_id`: The file ID of an uploaded file

**Example:**
```json
{
  "action": "file-to-base64",
  "file_id": "abc123def456"
}
```
Returns: `{ "file_id": "abc123def456", "filename": "report.pdf", "content_type": "application/pdf", "size_bytes": 4096, "base64": "..." }`

---

### base64-to-file
Decode a base64 string and save it as a file in cloud storage.

**Required fields:**
- `action`: `"base64-to-file"`
- `input`: Base64-encoded file content
- `filename`: Name for the created file (e.g., `"output.png"`)

**Optional fields:**
- `content_type`: MIME type for the file (default: `"application/octet-stream"`). Use the appropriate type, e.g., `"image/png"`, `"application/pdf"`.
- `expiration_days`: Number of days until the file expires, 1-7 (default: 7)

**Example:**
```json
{
  "action": "base64-to-file",
  "input": "iVBORw0KGgo...",
  "filename": "screenshot.png",
  "content_type": "image/png",
  "expiration_days": 3
}
```
Returns: `{ "file_id": "...", "filename": "screenshot.png", "content_type": "image/png", "size_bytes": 2048, "signed_url": "https://...", "signed_url_expires_in": "..." }`

---

## Common Workflows

1. **Encode a file for transmission**: Use `file-to-base64` to get a file's base64 content, then share or embed it.
2. **Reconstruct a file from base64 data**: Use `base64-to-file` to decode received base64 data back into a downloadable file.
3. **Inspect binary content**: Chain `file-to-base64` then `base64-to-hex` or `base64-to-binary` to view raw byte contents of a file.
4. **Convert between encodings**: Use any combination of the encoding actions to translate between base64, hex, and binary formats.

## Important Notes

- File size limit for `file-to-base64` is 10 MB. Larger files cannot be returned inline.
- Binary strings must have a length that is a multiple of 8 (one complete byte per group). Spaces between byte groups are allowed.
- Hex strings must have an even number of characters.
- Files created with `base64-to-file` are stored in cloud storage and expire after the specified number of days (default 7).
- The `signed_url` returned by `base64-to-file` provides a temporary download link for the created file.

### Frequently Asked Questions

#### How do I connect this tool to an external agent?

- Page URL: https://www.agentpmt.com/faq
- Markdown URL: https://www.agentpmt.com/faq?format=agent-md

You can install the local MCP server by opening a terminal and running:

```
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

This will connect you to local agents like Claude Code, Windsurf, Grok Build, Cursor, etc.

Alternatively you can connect to the hosted version with this config block, no installation required:

```
{
  "mcpServers": {
    "agentpmt": {
      "type": "streamable-http",
      "url": "https://api.agentpmt.com/mcp",
      "headers": {
        "Authorization": "Bearer <AGENTPMT_BEARER_TOKEN>",
        "x-instance-metadata": "{\"client\":\"generic-mcp\",\"platform\":\"remote\"}"
      }
    }
  }
}
```

[View MCP Connection Instructions](/docs/mcp-reference/connection) for more details.

#### How does an external agent use this tool?

- Page URL: https://www.agentpmt.com/faq
- Markdown URL: https://www.agentpmt.com/faq?format=agent-md

After the external agent is connected to an Agent Group that can use this tool, paste this prompt into the agent:

> Call the AgentPMT-Tool-Search-and-Execution tool with action 'get\_schema' and tool\_id 695c3605767df5adfd9bc86d ("Binary To/From File Converter"). Then call the same tool with action 'call\_tool', tool\_id 695c3605767df5adfd9bc86d, and the parameters needed for my request.

The agent should fetch the tool schema first, collect the required parameters for your request, and then call the tool through AgentPMT.

### Dependencies

These products are automatically added when this product is enabled on the page UI.

#### File Management

Upload, list, retrieve, share, download, delete, and manage files stored in AgentPMT cloud storage. This product now owns the full file lifecycle, including signed upload URLs for files up to 10MB and for files over 10MB up to 100MB, budget-scoped file listing with preview URLs, fresh signed download URLs, direct base64 download for smaller files, password-protected sharing, metadata and tag updates, access-history inspection, and expiration extension. All file operations are scoped to the current budget for isolation and are designed to let one budget create persistent files that can be revisited across later agent runs.

- Page URL: https://www.agentpmt.com/marketplace/file-management
- Markdown URL: https://www.agentpmt.com/marketplace/file-management?format=agent-md