Base64 검증기
문자열을 붙여넣어 유효한 Base64인지 확인하세요. Base64 문자 집합, 패딩 정확성 및 MIME 유형을 분석합니다. 100% 클라이언트 사이드.
100% 클라이언트 사이드 — 데이터가 기기를 떠나지 않습니다
Paste a Base64 string above to validate it
코드 예제
프로젝트에 바로 사용할 수 있는 코드 스니펫입니다.
JavaScript
// Validate Base64 with regex + decode attempt
function isValidBase64(str: string): boolean {
// Strip data URI prefix if present
const clean = str.includes(",") ? str.split(",")[1] : str;
// Quick character check
if (!/^[A-Za-z0-9+/]*={0,2}$/.test(clean)) return false;
// Length must be multiple of 4
if (clean.length % 4 !== 0) return false;
// Try decoding
try {
atob(clean);
return true;
} catch {
return false;
}
}
console.log(isValidBase64("SGVsbG8=")); // true
console.log(isValidBase64("!!!bad!!!")); // false자주 묻는 질문
아래에서 검색하거나 가장 일반적인 질문을 둘러보세요.
Base64 문자열은 허용된 알파벳(A-Z, a-z, 0-9, +, /)에 없는 문자가 포함되거나, 패딩(=)이 잘못되었거나, 길이가 4의 배수가 아닌 경우(표준 Base64 기준) 유효하지 않을 수 있습니다.
검증기는 무엇이 잘못되었는지 정확히 알려줍니다. 자동으로 수정이 필요한 경우 누락된 패딩을 추가하고 유효하지 않은 문자를 제거할 수 있는 'Base64 복구 도구'를 사용하세요.
Related Tools
Base64 Converter
Encode text to Base64 or decode Base64 to text — all in one tool
Base64 Detector
Detect Base64 variants (RFC 4648, URL-Safe, MIME) with confidence scoring
Base64 Analyzer
Analyze Base64 strings to determine their validity, character set, padding, length, and decoded data type
Base64 Repair
Automatically fix corrupted Base64 strings by correcting padding and characters