Base64-кодер/декодер

Быстро преобразует текст в Base64 и декодирует строки Base64.

// about

Об этом инструменте

Base64 превращает обычный текст в специальную строку из букв и цифр. Этот инструмент позволяет закодировать текст в Base64 или декодировать его обратно.

Как использовать

  1. Введите или вставьте текст в поле.
  2. Выберите 'Закодировать' или 'Декодировать'.
  3. Нажмите 'Запустить' и скопируйте результат.

Зачем используют этот инструмент

  • Позволяет безопасно передавать текст без риска искажения символов.
  • Быстро расшифровывает строки Base64 из веб-ссылок.
  • Простой двусторонний конвертер без сложных настроек.

Часто задаваемые вопросы (FAQ)

Является ли Base64 шифрованием?

Нет! Это просто способ представления данных, чтобы избежать ошибок при передаче.

Почему в конце часто стоят знаки '='?

Это спецсимволы выравнивания длины данных.

Поддерживается ли кириллица и эмодзи?

Да, инструмент корректно обрабатывает любые символы.

Руководства · Кодирование · 10 мин чтения

Кодировка Base64: как она работает, где используется и распространённые заблуждения

Вложения в письмах, data URI для изображений и токены JWT — всё это опирается на Base64. В этом руководстве объясняется, что именно делает Base64, почему результат длиннее исходных данных и когда его стоит применять, а когда нет.

Любые компьютерные данные в конечном счёте состоят из байтов. Однако многие каналы безопасно передают только текст: тело письма, HTTP-заголовки, JSON-документы и URL. Если пропустить через них «сырые» байты изображения или шифротекст, управляющие символы и переводы строк могут повредить данные, а промежуточная система может их переписать.

Man   → TWFu
Hi    → SGk=
한    → 7ZWc
안녕  → 7JWI64WV
Разбираемся, как Base64 превращает 3 байта в 4 символа, что означает знак = в конце, чем отличается Base64URL и почему Base64 — это не шифрование.
Читать →
Сделать с ИИ

Создайте этот инструмент сами с помощью ИИ

Нужна своя версия? Скопируйте промпт в чат с ИИ или сохраните файл навыка для ИИ-агента. В них описаны функции, особые случаи и тесты, которые мы использовали.

Промпт и навык даны на английском — ИИ-инструменты хорошо его понимают.

Промпт-задание для ИИ

Вставьте как есть в Claude, ChatGPT или Gemini.

You are an experienced full-stack web developer. Build a web tool called "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.md)

Сохраните как .claude/skills/build-base64-tool/SKILL.md, чтобы агенты вроде Claude Code использовали его при каждой доработке инструмента.

---
name: build-base64-tool
description: Use when building or changing a Base64-кодер/декодер tool. Build a two-way converter that encodes text to Base64 and decodes Base64 back to text.
---

# Build: 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

Советы по работе с ИИ

  • Укажите стек (React, Vue или чистый HTML) в первой строке, чтобы код подошёл к проекту.
  • Попросите ИИ выполнить перечисленные тесты и показать результаты до принятия кода.
  • Не вставляйте настоящие пароли, данные клиентов и API-ключи; используйте примеры.