Developer Tools

HTTP 204 No Content

2xx Success. The request succeeded but there is no content to send in the response body.

Runs in your browser. Your files and text never leave your device - nothing is uploaded.

2xx Success

What it means

The request succeeded but there is no content to send in the response body.

PropertyDetail
Status class2xx Success
Defined inRFC 9110, Section 15.3.5
Cacheable by defaultYes. RFC 9110 lists it as heuristically cacheable, so a cache may reuse it without explicit freshness headers unless Cache-Control says otherwise.
Who needs to actNo one, unless a client expects a body that never arrives.

What does HTTP 204 No Content mean?

HTTP 204 No Content means the server successfully processed the request and is deliberately sending no response body. It is common after a DELETE, after a PUT or PATCH that saves changes, and for CORS preflight requests. Headers such as ETag can still describe the updated resource, but the message ends after the headers.

How 204 No Content works

RFC 9110 describes 204 as success that should not move the user away from the current view. Its classic use is a save action in an editor: the document stays on screen and only metadata changes. A 204 is terminated by the end of the header section, so it cannot carry content, and code that tries to parse it as JSON fails. Headers still count. After a PUT, an ETag on the 204 is the entity tag of the new representation, ready for the next conditional request. Browsers also accept any 2xx status for a CORS preflight, which is why many servers answer OPTIONS requests with 204.

Example 204 request and response

PUT /api/notes/12 HTTP/1.1
Host: api.example.com
Content-Type: application/json
If-Match: "v4"

HTTP/1.1 204 No Content
ETag: "v5"

The save succeeded and nothing is sent back. The new ETag is the value the next update should send in If-Match.

When servers send 204 No Content

  • A DELETE that removed the resource and has nothing more to report.
  • A PUT or PATCH that saved changes when the client already has the data.
  • Responses to CORS preflight (OPTIONS) requests, which only need headers.
  • Analytics beacons and tracking endpoints that just record a hit.

How to handle 204 No Content

If you consume the API

  • Check the status before calling response.json(); a 204 has no body, and parsing it throws an error.
  • Read any updated headers, such as ETag, from the 204 itself.

If you build the API

  • Never write a body on a 204; use 200 if you want to return the updated object.
  • Do not use 204 for a GET that found nothing. That is a 404, or a 200 with an empty list.

204 and SEO

Google's crawler documentation says a 204 leaves it with no content to process, and empty pages can be reported in Search Console as soft 404s. Never serve 204 for a page you want indexed; return 200 with the content, or a 404 if there is none.

Related status codes

  • 200 OK: Success with a body, the right choice if the client needs the updated resource back.
  • 205 Reset Content: Also bodiless, but asks the client to reset the form or view that sent the request.
  • 304 Not Modified: Also bodiless, but means "use your cached copy" rather than "action done".

Frequently asked questions

Sources

Other 2xx Success codes

Reviewed by Raja Jahangir · Last reviewed: October 7, 2026