Codificador/Decodificador Base64

Convierte texto a Base64 y decodifica cadenas Base64 rápidamente.

// about

Sobre esta herramienta

Base64 convierte letras y símbolos normales en un código especial de caracteres. Esta herramienta te permite convertir texto a Base64 o descifrar Base64 a texto normal.

Cómo usarla

  1. Escribe o pega tu texto en el cuadro.
  2. Selecciona 'Codificar' o 'Decodificar'.
  3. Haz clic en 'Ejecutar' y copia el resultado.

Por qué usar esta herramienta

  • Envía texto de forma segura sin que se rompan los caracteres especiales.
  • Descifra rápidamente cadenas Base64 encontradas en enlaces web.
  • Conversión fácil en ambas direcciones sin complicaciones.

Preguntas frecuentes (FAQ)

¿Base64 es una contraseña secreta?

¡No! Es solo un formato para evitar errores de lectura en internet.

¿Por qué termina con '='?

Son caracteres de relleno para ajustar el tamaño según exige el sistema.

¿Soporta acentos y emoticonos?

Sí, funciona perfectamente con todos los idiomas y emoticonos.

Guías · Codificación · 10 min de lectura

La codificación Base64 explicada: cómo funciona, dónde se usa y mitos comunes

Los adjuntos de correo, las data URI de imágenes y los tokens JWT dependen de Base64. Esta guía explica exactamente qué hace Base64, por qué el resultado es más largo que el original y cuándo conviene usarlo y cuándo no.

Todos los datos de un ordenador son, en última instancia, bytes. Sin embargo, muchos canales solo transportan texto de forma segura: cuerpos de correo, cabeceras HTTP, documentos JSON y URL. Si se envían por ellos bytes de imagen en bruto o texto cifrado, los caracteres de control y los saltos de línea pueden corromper los datos, o un sistema intermedio puede reescribirlos.

Man   → TWFu
Hi    → SGk=
한    → 7ZWc
안녕  → 7JWI64WV
Aprende cómo Base64 convierte 3 bytes en 4 caracteres, qué significa el = final, en qué se diferencia Base64URL y por qué Base64 no es cifrado.
Leer guía →
Créalo con IA

Crea esta herramienta tú mismo con IA

¿Quieres tu propia versión? Copia el prompt en un chat de IA o guarda el archivo de skill para un agente de programación. Incluyen las funciones, casos límite y pruebas que usamos al crearla.

El prompt y la skill están en inglés, que las herramientas de IA entienden perfectamente.

Prompt de instrucciones para IA

Pégalo tal cual en Claude, ChatGPT o Gemini.

You are an experienced full-stack web developer. Build a web tool called "Codificador/Decodificador Base64" that meets the requirements below.

## Goal

Build a two-way converter that encodes text to Base64 and decodes Base64 back to text.

## Core features

- Switch between encode and decode
- UTF-8 handling so non-English text and emoji work
- Choose standard Base64 or Base64URL (-, _)
- Option to keep or omit padding (=)
- Copy-to-clipboard button for the result

## Inputs

- Text or a Base64 string
- Mode (encode/decode), variant (standard/URL), padding on/off

## Outputs

- Converted string
- Byte length of input and output

## Edge cases and handling rules

- Strip spaces and line breaks before decoding
- Restore missing padding so the length is a multiple of 4
- Show an error with the position of any non-Base64 character
- Warn when decoded bytes are not valid UTF-8

## Implementation requirements

- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.
- Make the UI responsive and easy to use on mobile; label every input and keep everything keyboard accessible.
- Add a Copy button for results and show clear, friendly error messages for invalid input.
- Keep the core logic in functions separate from the UI so it can be unit-tested.

## Definition of done (test cases)

- 'Man' → 'TWFu' and 'Hi' → 'SGk='
- '한' → '7ZWc' and decodes back to '한'
- Bytes FB FF give '+/8=' in standard and '-_8=' in URL variant

First outline your implementation plan in at most five lines, then write the complete code, and finally explain how to check the test cases above.

Skill (SKILL.md)

Guárdalo como .claude/skills/build-base64-tool/SKILL.md para que agentes como Claude Code lo reutilicen cada vez que crees o cambies la herramienta.

---
name: build-base64-tool
description: Use when building or changing a Codificador/Decodificador Base64 tool. Build a two-way converter that encodes text to Base64 and decodes Base64 back to text.
---

# Build: Codificador/Decodificador Base64

## Goal

Build a two-way converter that encodes text to Base64 and decodes Base64 back to text.

## Workflow

1. Review the required features, inputs and outputs below and ask about anything missing first.
2. Implement the core logic as pure functions separate from the UI.
3. Check the logic against the test cases in the verification list.
4. Build a responsive UI with an input form, a result area and a Copy button.
5. Reproduce each edge case listed under Rules and refine the error messages.

## Core features

- Switch between encode and decode
- UTF-8 handling so non-English text and emoji work
- Choose standard Base64 or Base64URL (-, _)
- Option to keep or omit padding (=)
- Copy-to-clipboard button for the result

## Inputs

- Text or a Base64 string
- Mode (encode/decode), variant (standard/URL), padding on/off

## Outputs

- Converted string
- Byte length of input and output

## Rules

- Strip spaces and line breaks before decoding
- Restore missing padding so the length is a multiple of 4
- Show an error with the position of any non-Base64 character
- Warn when decoded bytes are not valid UTF-8
- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.

## Verification

- [ ] 'Man' → 'TWFu' and 'Hi' → 'SGk='
- [ ] '한' → '7ZWc' and decodes back to '한'
- [ ] Bytes FB FF give '+/8=' in standard and '-_8=' in URL variant

Consejos para trabajar con IA

  • Indica tu stack (React, Vue o HTML puro) en la primera línea para obtener código adecuado.
  • Pide que ejecute las pruebas listadas y muestre los resultados antes de aceptar el código.
  • No pegues contraseñas reales, datos de clientes ni claves de API; usa valores de ejemplo.