New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

base64-tool

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base64-tool

Encode and decode Base64 strings with UTF-8 support. Simple, fast, zero-dependency Base64 utility for Node.js and browsers.

npmnpm
Version
1.0.1
Version published
Weekly downloads
4
300%
Maintainers
1
Weekly downloads
 
Created
Source

@devkits/base64-tool

Part of DevKits

Encode and decode Base64 strings with UTF-8 support. Simple, fast, zero-dependency Base64 utility for Node.js and browsers.

🧰 DevKits Pro Tools

This package is part of DevKits — 82+ free developer tools. The online Base64 tool supports file upload, batch encoding, and URL-safe variants.

Try Online with Advanced Features

Installation

npm install @devkits/base64-tool

Usage

const { encode, decode, encodeURLSafe, isValidBase64 } = require('@devkits/base64-tool');

// Encode a string to Base64
const encoded = encode('Hello, 世界!');
// 'SGVsbG8sIOS4lueVjCE='

// Decode Base64 back to string
const decoded = decode('SGVsbG8sIOS4lueVjCE=');
// 'Hello, 世界!'

// URL-safe Base64 (no padding, replaces + and /)
const urlSafe = encodeURLSafe('Hello+World/Test');
// 'SGVsbG8rV29ybGRfVGVzdA'

// Validate Base64 strings
isValidBase64('SGVsbG8='); // true
isValidBase64('invalid!!'); // false

API

encode(input)

Encodes a string to Base64 with UTF-8 support.

decode(input)

Decodes a Base64 string with UTF-8 support. Throws an error for invalid input.

encodeURLSafe(input)

Encodes a string to URL-safe Base64 (uses - and _ instead of + and /, no padding).

isValidBase64(input)

Checks if a string is valid Base64 (standard or URL-safe format).

Features

  • UTF-8 support (works with Chinese, Japanese, Korean, emojis, etc.)
  • URL-safe Base64 encoding
  • Base64 validation
  • Zero dependencies
  • Works in Node.js and browsers
  • TypeScript-friendly (JSDoc comments included)

See Also

Free Online Version: DevKits - Base64 Tool

Other DevKits npm Packages

PackageDescription
@devkits/json-formatterFormat and validate JSON
@devkits/chmod-calculatorUnix file permissions
@devkits/cron-parserParse cron expressions
@devkits/csv-json-converterConvert between CSV and JSON
@devkits/diff-checkerCompare text differences
@devkits/docker-compose-parserParse docker-compose files
@devkits/env-editor.env file utilities
@devkits/markdown-toolsMarkdown parsing utilities
@devkits/regex-testerRegular expression utilities

Browse all 82 tools at DevKits

License

MIT

Keywords

base64

FAQs

Package last updated on 09 Mar 2026

Related posts