btoa/atob(string)
btoa() - Binary to ASCII
encoded = btoa("Hello, world!")
log encoded // "SGVsbG8sIHdvcmxkIQ=="Syntax
btoa(content)Parameters
Return Value
atob() - ASCII to Binary
decoded = atob("SGVsbG8sIHdvcmxkIQ==")
log decoded // "Hello, world!"Syntax
Parameters
Return Value
Use Cases
Examples
Data URI Creation
Simple Text Encoding/Decoding
Working with APIs that Return Base64
Notes
Last updated