PUT vs PATCH — What's the Difference?

PUT replaces an entire resource with the representation provided in the request; PATCH applies a partial update, modifying only the specified fields.

Published October 3, 2026

PUT replaces the entire resource with the body you send; PATCH changes only the fields you include. Use PUT for full updates and PATCH for partial ones.

The concept

PUT is idempotent: sending the same full representation twice leaves the same state. Missing fields are reset or removed because the body is the new resource.

PATCH describes a change. It is often not guaranteed idempotent, since a patch such as 'increment by 1' changes state each time.

Effect on a user

before: {name:'Ada', city:'Pune', age:36}
PUT {name:'Ada B', city:'Pune'}
after: {name:'Ada B', city:'Pune'} (age lost)
PATCH {name:'Ada B'}
after: {name:'Ada B', city:'Pune', age:36} (rest kept)

Practical examples

PUT

PUT /users/7
Content-Type: application/json

{"name":"Ada","city":"Pune","age":36}

PATCH (merge patch)

PATCH /users/7
Content-Type: application/merge-patch+json

{"city":"Mumbai"}

Express handlers

app.put('/users/:id', (q, r) => r.json(replace(q.params.id, q.body)))
app.patch('/users/:id', (q, r) => r.json(merge(q.params.id, q.body)))

Common mistakes

  • Using PUT with partial bodies and wiping fields.
  • Assuming PATCH is idempotent.
  • Not validating which fields a PATCH may change.

Key takeaways

  • PUT = replace, PATCH = modify.
  • PUT is idempotent.
  • Send the full resource for PUT.

FAQ

Can PUT create a resource?

Yes, if the client chooses the URL and it does not exist.

Do all APIs support PATCH?

No, some only offer PUT.

More HTTP articles