# Async/Await

> Async code that reads top to bottom. await waits for each result.

**Field:** Software Development  
**Category:** Programming Paradigms  
**Also known as:** async await, async, await

## Think of it like

Think of it like a recipe that says wait for the oven. You read it top to bottom, like any recipe.

## Definition

Async/await lets you write async code that reads like normal step-by-step code. You mark a function with async, then put await in front of a slow call. At an await, the function pauses until the result is ready, while the rest of the program keeps running. Errors are caught with a plain try and catch. JavaScript, Python, C# and Rust all have it.

## Example

Emma writes const data = await fetch(url). The next line can use data, and the page never freezes while it waits.

## Example code

```javascript
async function load() {
  const res = await fetch("/api/user");
  return await res.json();
}
```

Each await waits for its step, and the code still reads in order.

## Why it matters

It is the most common way to write async code today. It is far easier to read than chains of callbacks.

## Common mistake

Putting await on each call in a row when they do not depend on each other. Start them together with Promise.all.

## Three principles

- **Reads in order.** Like normal code.
- **await pauses.** Only this function.
- **Built on promises.** Same thing underneath.

## Related terms

- [Promise (JavaScript)](https://learn.benibix.com/term/development/promise)
- [Asynchronous Code](https://learn.benibix.com/term/development/asynchronous-code)
- [Callback Function](https://learn.benibix.com/term/development/callback)
- [Event Loop](https://learn.benibix.com/term/development/event-loop)

## Told apart from

- [Promise vs Async/Await](https://learn.benibix.com/compare/promise-vs-async-await): People think async and await replace promises for good, and they do not. An async function still hands back a promise. The word await is a tidier way to wait for one, so the code reads from top to bottom. Under the hood it is the same promise. The then and catch calls just turn into plain lines inside a try and catch.

## Taught in

- [Fetch API and JSON](https://learn.benibix.com/learn/development-web/fetch-api-and-json): HTML, CSS and JS, 13/14

---

Source: https://learn.benibix.com/term/development/async-await
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
