Side by side
PromisevsAsync/Await
What is the difference between a promise and async/await?
Updated 2 min read7 differences
In short
A promise is an object for a value that arrives later; async/await is syntax built on promises that lets you wait for them in step-by-step code.
Promise
A promise is an object that represents the eventual result of an asynchronous operation, letting code react to success or failure once the work completes.
Read the page on PromiseAsync/Await
Async/await is a syntax for writing asynchronous code that reads like ordinary step-by-step code, pausing at each await until a promise or task finishes.
Read the page on Async/AwaitPromise and Async/Await compared
| Aspect | Promise | Async/Await |
|---|---|---|
| What it is | An object that represents a future value | Syntax for writing promise-based code |
| Code style | A chain of .then() callbacks | Step-by-step code with await |
| Errors | .catch() at the end of the chain | try/catch around the awaited steps |
| Returns | A new promise from every .then() | A promise from every async function |
| Running in parallel | Promise.all, Promise.race and similar helpers | Still uses Promise.all; plain await runs steps in order |
| Debugging | Harder to step through across many callbacks | Steps through like synchronous code |
| Added to JavaScript | ES2015 | ES2017 |
The difference, explained
A promise is an object that stands for the result of an asynchronous operation: it starts pending and later becomes fulfilled with a value or rejected with an error. Async/await is syntax for using promises: an async function always returns a promise, and inside it await pauses the function until a promise settles, then hands back its value or throws its error.
So they are not rivals; async/await is another way of writing the same thing. With promises alone, you chain a .then() for each step and end with a .catch() for errors. With async/await, the same steps read top to bottom like ordinary code, local variables stay in scope from one step to the next, and errors are handled with a regular try/catch.
You still use promises directly in async code. Running independent tasks at once needs Promise.all, Promise.allSettled or Promise.race, and wrapping an old callback or event API takes new Promise. A common mistake is awaiting independent calls one after another, which makes them run in sequence; start them together and await them with Promise.all instead.
Another misconception is that await blocks the program. It pauses only the async function it is in; the event loop keeps handling clicks, timers and other requests in the meantime. Both styles perform the same, so the choice is about readability: async/await for sequences of steps, promise methods for combining several operations.
Which one should you use?
Choose Promise when…
- You run several operations at once and combine them with
Promise.allorPromise.race. - You wrap a callback- or event-based API in
new Promiseso it can be awaited. - A short, one-step chain reads clearly enough on its own.
Choose Async/Await when…
- The code is a sequence of steps that depend on each other.
- You want to handle errors with ordinary
try/catchblocks. - You need loops or conditions between asynchronous steps.
Loading a user's paid orders, both ways
// Promise chain: each step in a .then()
function loadPaidOrders(id) {
return fetchUser(id)
.then((user) => fetchOrders(user.id))
.then((orders) => orders.filter((o) => o.paid))
.catch((error) => {
console.error("Could not load orders", error);
return [];
});
}// async/await: the same steps, top to bottom
async function loadPaidOrders(id) {
try {
const user = await fetchUser(id);
const orders = await fetchOrders(user.id);
return orders.filter((o) => o.paid);
} catch (error) {
console.error("Could not load orders", error);
return [];
}
}Readers ask
Is async/await better than promises?
It is easier to read for most sequential code, but it is not a replacement: it is built on promises and uses them underneath. Most modern code mixes both, with await for steps and Promise.all for parallel work.
Is async/await slower than promises?
No meaningful difference. Both run on the same promise machinery; the real slowdown comes from awaiting independent tasks one by one instead of together.