Beware of phishing attacks, Ledger will never ask for the 24 words of your recovery phrase. Never share them. Learn more

How to cancel a stuck transaction in MetaMask using nonce

This article describes the process of canceling a stuck transaction in MetaMask using nonce.

If you've ever sent a transaction on Ethereum, you know how frustrating it can be when your transaction gets stuck. Thankfully, there is a way to cancel a transaction in MetaMask using nonce. Nonce is a unique number that identifies a transaction and prevents replay attacks on the network.

Video instructions

Before you start

  • Update Ledger Live to the latest version by using this link.
  • Connect your Ledger device to Ledger Live and check that it has the latest firmware version.
  • Make sure the latest version of the Ethereum (ETH) app is installed on your Ledger device.

After completing these steps, close Ledger Live as it may cause conflicts with MetaMask.

Where can I find my nonce value?

To cancel out a stuck transaction, you first need to find the nonce value of the transaction. You can do this by searching for the transaction hash on a blockchain explorer like Etherscan. Once you've found the transaction, you can see its nonce value listed in the details.

  1. Connect your Ledger device to MetaMask. Unsure about how to connect? Click here to learn more.  

  2. Enable custom nonces by clicking on the profile icon in the top right corner of the MetaMask window, selecting Settings, clicking on Advanced, and turning on Customize transaction nonce.

  3. Create a new transaction in MetaMask by clicking Send.

  4. Paste your address in the To field and set the value to 0 ETH.

  5. Before confirming the transaction, you will see a box to input a nonce. Input the same nonce as the stuck transaction. For example, if the stuck transaction was "4," then you should input "4" as the nonce for the new transaction.

  6. Set a higher gas limit for the new transaction than the one that is stuck. If the gas limit is the same or lower, the new transaction will fail immediately.

  7. Set the gas fee to a high estimate to ensure that the transaction goes through quickly.

  8. Confirm the transaction to send the new transaction.

  9. This will replace the stuck transaction with the new one, effectively canceling the original transaction.

  Have multiple stuck transactions?

If you have multiple stuck transactions, it's important to cancel them out in the correct order. This means canceling the transaction with the lowest nonce value first, then moving on to higher nonce values. This is because the Ethereum network processes transactions in order of their nonce values, so if a lower nonce transaction is stuck, it can block subsequent transactions with higher nonce values.

Canceling a stuck transaction in MetaMask using nonce is a simple process that can save you a lot of time and frustration. Just make sure to enable custom nonces, create a new transaction with the same nonce, set a high gas limit, and confirm the transaction. With these steps, you can easily cancel any stuck transaction on the Ethereum network.

  Still having issues canceling a stuck transaction?

If you've attempted all the above steps and are still encountering issues, consider changing the RPC value to the Chainlist RPC: https://api.securerpc.com/v1 and resending the transaction. Learn more about connecting to Chainlist here

Was this article helpful?