How to View WebSocket Messages in Chrome DevTools
In the Network panel of Chrome DevTools, select a WebSocket connection and open the Messages tab. There you can see the messages the browser sent and received, one row at a time, in a table. This is useful for features where the screen updates in real time, such as chat, notifications, or stock counts, when you want to confirm what the page sent and what the server returned. In my test environment, I set up a server that exchanged text and binary messages and checked what appeared in the Messages tab and how.
The test environment was Ubuntu 24.04, Node.js 22, and Chrome for Testing 153.0.8010.12. I ran Chrome with a window on a virtual display and opened DevTools on the right side. I set DevTools to English, so the tab and button names below are in English. The times in the Time column are from the clock of the test environment (UTC). I did not test macOS or Windows Chrome, wss:// (TLS) connections, opening DevTools after the connection was already established, or more than a few thousand messages.
- 1. The server and page used in the test
- 2. Finding the WebSocket connection in the Network panel
- 3. Checking sent and received messages in the Messages tab
- 4. Opening the contents of a message
- 5. Filtering by direction and by regular expression
- 6. What did not appear in the table
- 7. Even past 100 messages, the first row remained
- 8. Clearing the table
The server and page used in the test
The server was written with Node.js's http module and the ws package (8.23.0), and accepted WebSocket connections at ws://localhost:8080/chat. As soon as a connection opened, it sent one welcome message. After that, it replied according to the type of each message received from the page, as follows.
| What the page sent | What the server returned |
|---|---|
{"type":"chat","text":"こんにちは"} |
{"type":"echo","text":"こんにちは"} |
{"type":"image"} |
12 bytes of binary (89 50 4E 47 …) |
| 5 bytes of binary | {"type":"binary-received","bytes":5} |
{"type":"ping"} |
A ping frame (no message returned) |
{"type":"many"} |
150 messages, {"type":"tick","n":1} through n = 150 |
{"type":"bye"} |
Closes the connection with code 1000 and reason see you |
The page sends each message when a button is pressed.
const ws = new WebSocket(`ws://${location.host}/chat`);
ws.binaryType = 'arraybuffer';
const send = (obj) => ws.send(JSON.stringify(obj));
document.getElementById('chat').onclick = () => send({ type: 'chat', text: 'こんにちは' });
document.getElementById('upload').onclick = () => ws.send(new Uint8Array([1, 2, 3, 4, 5]));
The other buttons send their messages in the same way, by changing only the type, as in send({ type: 'image' }).
Finding the WebSocket connection in the Network panel
With the Network panel of DevTools open, I reloaded the page. The list showed the page itself, localhost, and the WebSocket chat. For chat, the Status was 101 Switching Protocols, the Type was websocket, and the Time stayed at Pending.
On pages with a lot of traffic, the filter buttons by type make the connection easier to find. The official documentation section on filtering by type names the button "WS", but in the Chrome in my test environment it was labeled "Socket". Clicking Socket reduced the list to the single chat row.

Clicking the chat row shows the tabs Headers, Messages, Initiator, and Timing on the right. The Headers tab shows the exchange that switched the connection to WebSocket. Request URL was ws://localhost:8080/chat, and Status Code was 101 Switching Protocols. The Response headers included Upgrade: websocket and Sec-Websocket-Accept.

Checking sent and received messages in the Messages tab
The official documentation section on inspecting WebSocket messages describes selecting the WebSocket connection in the list and opening the Messages tab.
When I opened the Messages tab, the table already had one row: the welcome message received right after the connection opened. Then, as I pressed the buttons on the page in turn, rows were added to the table.

The table contents, written out as text, are as follows. The direction is shown by the arrow at the start of each row.
| Direction | Data | Length | Time |
|---|---|---|---|
| Received | {"type":"welcome","text":"ようこそ、猫の手チャットへ"} |
41 | 23:00:25.597 |
| Sent | {"type":"chat","text":"こんにちは"} |
30 | 23:00:33.191 |
| Received | {"type":"echo","text":"こんにちは"} |
30 | 23:00:33.192 |
| Sent | {"type":"image"} |
16 | 23:00:35.021 |
| Received | Binary message | 12 B | 23:00:35.023 |
| Sent | Binary message | 5 B | 23:00:36.835 |
| Received | {"type":"binary-received","bytes":5} |
36 | 23:00:36.838 |
| Sent | {"type":"ping"} |
15 | 23:00:38.649 |
From the table, I could confirm the following.
- Sent messages have a green upward arrow and a pale green background. Received messages have a red downward arrow and a white background. The official documentation also says that sent text is shown in pale green and received text in white.
- Text messages appear as-is in the Data column. Binary messages show "Binary message" in Data, and the Length column includes a B, as in "12 B".
- The Time column shows the time a message was sent or received, down to the millisecond. From sending
chatuntilechocame back took 1 millisecond.
The official documentation says that to refresh the table, you click the connection name in the list again. In my test environment, pressing the buttons while the Messages tab stayed open added rows each time, without clicking again.
Length was in characters, not bytes
The official documentation says Length is the number of bytes in the message. However, for messages containing Japanese text, the Length in the table did not match the UTF-8 byte count. It matched the JavaScript string length (number of characters).
| Message | Length in table | Characters (length) |
UTF-8 bytes |
|---|---|---|---|
{"type":"welcome","text":"ようこそ、猫の手チャットへ"} |
41 | 41 | 67 |
{"type":"chat","text":"こんにちは"} |
30 | 30 | 40 |
{"type":"image"} |
16 | 16 | 16 |
For messages with only ASCII characters, the character count and byte count are the same, so no difference appears. If you want to estimate the size of the data sent and the message contains Japanese text, do not read the Length in the table directly as a byte count. The binary rows "12 B" and "5 B" matched the 12 bytes sent by the server and the 5 bytes sent by the page.
Opening the contents of a message
Clicking a row in the table opens that row's contents in the pane below the table.
Selecting the echo row showed the JSON in the form {type: "echo", text: "こんにちは"}, with one line per property.

Selecting the received "Binary message" row showed the bytes in hexadecimal in the pane below. 89 50 4E 47 0D 0A 1A 0A 00 01 FE FF is exactly the 12 bytes the server sent. On the right, the bytes are shown as characters, with unreadable bytes displayed as ., like . P N G . ..

The selector at the lower left of the pane lets you choose the display from Base64, Hex viewer, and UTF-8. Base64 produced the single line iVBORw0KGgoAAf7/, and UTF-8 produced characters like �PNG, with unreadable bytes shown as symbols. When I selected the row for the 5 bytes sent by the page, the Hex viewer showed 01 02 03 04 05.
Filtering by direction and by regular expression
The selector labeled "All" above the table lets you choose All, Send, or Receive. Choosing Send left only the four sent rows. Choosing Receive left only the four received rows.

In the "Filter using regex" field to the right, entering a regular expression leaves only the rows whose Data matches. In my test, filtering worked as follows.
| Text entered | Rows remaining |
|---|---|
echo |
Only the received {"type":"echo",…} |
Binary |
Only the received {"type":"binary-received",…} |
Entering type":"(chat|echo) with the | alternation left two rows: the sent chat and the received echo.
Entering Binary did not leave the two rows whose Data shows "Binary message". The text "Binary message" shown in the table is not the target of the filter, so this field cannot be used to keep only binary messages.
What did not appear in the table
The official documentation says that the Data column can show frame type names and codes such as Ping Frame and Connection Close Frame. In my test environment, the following did not appear as rows in the table.
- The ping frame sent by the server and the pong frame returned by the browser. The server log showed "sent ping" and "received pong", so the exchange did happen. Ping and pong are control frames used to check the connection, not data (MDN, the section on ping and pong in the guide to writing WebSocket servers).
- The server closing the connection. The server closed it with code 1000 and reason
see you, and the page'sonclosereceivedcode 1000andreason see you. Even after I clickedchatin the list again, the last row of the table was still{"type":"bye"}, the message the page had sent.
To check why a connection closed, or the ping and pong exchange, you need to look at the page's onclose handler or the server log, not the Messages tab.
Even past 100 messages, the first row remained
The official documentation says the table shows the last 100 messages. In my test environment, after receiving 150 tick messages, when I scrolled the table all the way to the top, the first welcome message was still there. The table had 159 rows in total.
Clearing the table
Pressing the circle-with-a-slash button at the upper left of the Messages tab (Clear all appears when you hover over it) emptied the table. Clicking chat in the list again did not bring the rows back. If you clear the table for a connection that has already ended, its messages can no longer be viewed in the Messages tab.





