blog

Hedera Processes Thousands of Transactions Per Second… See How that Number is Calculated

November 2, 2023
Ed Marquez
Ed Marquez
Head of Developer Relations

At the time of this writing (November 2nd, 2023), the Arkhia Metrics site shows that the Hedera mainnet is processing 2,443 transactions per second (TPS), with more than 26 billion total transactions to date. The article Does Hedera’s TPS Include Transactions Generated by its Consensus Algorithm? Spoiler alert: NO states that the publicly reported transaction count on Hedera does not include the intra-node gossip communication needed to reach consensus. Only transactions submitted and paid for by external parties are included in the TPS count. But, how is that number calculated?

For the curious minds out there, this article shows how anyone can calculate TPS on Hedera. It provides Python and JavaScript code that you can use to find the latest TPS number. The goal is to highlight how everyone can benefit from the transparency on-chain data provides.

If you are interested in seeing how Hedera’s latest TPS compares to that of other Layer 1 and Layer 2 networks, see the Chainspect TPS Dashboard.

As you read the article, keep in mind the equation below. Now, let’s do some fun math!

TPS = Transactions in X Blocks (#) / Duration of X Blocks (seconds)

1. Fetching the Block Data

As explained in the glossary of the Hedera Documentation, a block is simply a batch of transactions. Hedera’s hashgraph consensus algorithm inherently doesn’t utilize blocks. However, to enhance compatibility with Ethereum Virtual Machine (EVM) tools and systems, the notion of “virtual blocks” was integrated on Hedera with HIP-415. Each block on Hedera represents transactions processed in a time window of approximately 2 seconds. 

The script uses the mirror node REST API to obtain the data for the last five blocks, providing a snapshot of roughly 10 seconds. You can modify the script to take as many blocks as you like. Here’s how to fetch the data:

Here’s a sample of the data that a query returns for a block:


{
  "blocks": [
    {
      "count": 3628,
      "hapi_version": "0.40.0",
      "hash": "0x307f22d2fcdfa56925ac2288a639efceb4aae005ff8c9e961ff3ce6141ed1f18c780116b98bdf7ddcdbaa0087cb2449e",
      "name": "2023-10-20T15_37_40.009866397Z.rcd.gz",
      "number": 54899144,
      "previous_hash": "0x72412103ff7a3823bebbe913a1cd0b2de0c835a936ccd26ed2a1db2a75f0119503fe0517d0bbe322e3264c340e3ac799",
      "size": 887005,
      "timestamp": {
        "from": "1697816260.009866397",
        "to": "1697816261.999298266"
      },
      "gas_used": 0,
      "logs_bloom": "0x"
    }
  ],
  "links": {
    "next": "/api/v1/blocks?limit=1&block.number=lt:54899144"
  }
}

You can also see detailed information about blocks from a Hedera network explorer, like HashScan.

2. Adding Up the Transactions

Next, we need to find the total number of transactions processed over these five blocks. This is a straightforward process: loop through each block and keep a running tally of the transaction counts. Here’s the code that achieves this:

3. Calculating the Duration of the Time Window

We also need to determine the exact duration these five blocks took. Remember, while each block takes approximately 2 seconds, the actual duration might vary slightly. Keep in mind that each block also has a starting and ending timestamp.

We calculate the total duration of the time window by subtracting the starting timestamp of the oldest block from the ending timestamp of the newest block:

4. Calculating TPS

With the total number of transactions and the exact duration, it’s time for the grand reveal.

The final step is the easiest. We simply divide the total number of transactions by the duration (in seconds) to get the TPS number:

To see the fruits of your labor, just run the scripts!

5. Wrapping Up

You learned how to easily calculate TPS on Hedera with just a few lines of code. Whether you’re tracking performance, doing research, or satisfying your curiosity, this process shows how everyone can benefit from the transparency that on-chain data provides.

    Happy coding!

    Continue Learning

    Back to Blog

    discover

    See more articles

    January 26, 2026

    Hedera at Davos 2026: Advancing digital trust 

    Hedera returned to the World Economic Forum’s Annual Meeting in Davos, 2026, engaging policymakers, enterprise leaders, and innovators in forward-looking conversations.
    Read More
    January 23, 2026

    Hedera Council Welcomes 4 New Partners 

    Halborn joins as a Strategic Partner, alongside new Community Partners Hashpack, Hashgraph Online, and Genfinity Hedera Council is proud to welcome Halborn as the newest member of the Council’s Strategic

    Read More
    January 22, 2026

    McLaren Racing and Hedera Partner to Expand Digital Fan Engagement

    McLaren Racing today announced a multi-year partnership with Hedera Foundation to leverage Hedera, the trusted public network for building fast, secure, and compliant decentralised applications. Hedera will become an Official
    Read More