Window atob() in JavaScript

Learn via video course
FREE
View all courses
JavaScript Course With Certification: Unlocking the Power of JavaScript
JavaScript Course With Certification: Unlocking the Power of JavaScript
by Mrinal Bhattacharya
1000
4.8
Start Learning
JavaScript Course With Certification: Unlocking the Power of JavaScript
JavaScript Course With Certification: Unlocking the Power of JavaScript
by Mrinal Bhattacharya
1000
4.8
Start Learning
Topics Covered

Overview

The Window atob() in JavaScript is used to decode a base-64 encoded string. atob in the JS method is used for decoding data encoded with btoa(). Decoding returns a string representing the decoded string.

Syntax of Window atob() in JavaScript

The syntax of Window atob() in JavaScript is given as:

Transform Your Career

Choose from our industry-leading programs designed for career success

NSDC Certified

Modern Software and AI Engineering Program

Master full-stack development with AI integration

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Modern Data Science and ML with specialisation in AI

Advanced data science techniques with AI specialization

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Advanced AIML with Specialisation in Agentic AI

Deep dive into AIML with focus on Agentic systems

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

DevOps, Cloud & AI Platform Engineering

Build and manage AI-powered cloud infrastructure

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

AI Engineering Advanced Certification by IIT-Roorkee

Premier AI engineering certification from IIT-Roorkee

3 MonthsDuration
AI-LedCurriculum
Career SupportSupport
Program highlights
Go to Program

Parameters of Window atob() in JavaScript

The following parameter of atob in JS is:

encodedData - The string which is to be decoded. It is a binary string that contains base64-encoded data. In a binary string, each character is treated as a byte of binary data.

It is mandatory to provide a parameter to the Window atob() in JavaScript.

Return Value of Window atob() in JavaScript

atob in JS returns decoded data from encodedData as an ASCII string.

Exceptions of Window atob() in JavaScript

InvalidCharacterError - Window atob() in JavaScript throws an error when the encodedData is not a valid base64 string.

Base64 string is an encoded string that represents binary data in an ASCII string

Turn Learning into Career Growth

1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary
1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary

Example

Output

What is Window atob() in JavaScript?

Window atob() in JavaScript decodes a string of data encoded with Base64 encoding using the atob() function.

To encode and transmit data that may otherwise cause communication problems, you can then use the btoa() method to encode your data, then transmit it and use the atob() method to decode it again.

Scaler Placement Report and Statistics

₹23L
AVG CTC
SCALER PLACEMENT PROOF

Scaler learners achieved 2.5x salary growth with average post-Scaler CTC reaching ₹23L.

11,000+placements
650+companies
Verified data

More Examples

The example below illustrates the use of the Window atob() in JavaScript.

Output

output-use-of-window-atob

Supported Browsers

Window atob() in JavaScript supports the following browsers:

BrowserVersion
Edge12
Internet Explorer10
Opera10.5
Firefox1
Safari3
Google Chrome4

Conclusion

  • The Window atob() in JavaScript stands for ASCII to binary.
  • A base-64 encoded string can be decoded with the Window atob() in JavaScript.
  • The parameter passed onto the Window atob() in JavaScript must be a valid base64 string.
  • A base64 string is an encoded string that represents binary data in an ASCII string.
  • It returns the decoded string.
  • The atob() and btoa() methods allow developers to transform data to and from the base64 encoding.
Hiring Partners:
GoogleGoogleAmazonAmazonMicrosoftMicrosoftFlipkartFlipkartAdobeAdobe1200+ more