For people that want to do a simple verification of a Monero address to ensure it has been entered correctly, what are some methods that can be employed?


5 Answers 5


Here is a simple regular expression and javascript code snippet that can be used to confirm a Monero address has been entered correctly.

Regular expression:


In Javascript:


Credit goes to /u/binaryfate for the useful info.

  • 2
    It is also worth noting that this doesn't ensure that there are no typos (can't really check checksum with regular expressions), and that it's suitable only for regular addresses
    – JollyMort
    Sep 13, 2016 at 18:00
  • 3
    To ferretinjapan, you might want to look at the code for steps 8 to 15 here. Might be beneficial to this question or for a new question.
    – dEBRUYNE
    Sep 13, 2016 at 18:49
  • 1
    If you go on moneroaddress.org and type in both 41a and 41z, you'll notice it says "INVALID PREFIX" for 41a (but not for 41z), while the a character is part of Base58. Therefore, I think the regular expression posted is still a simplification.
    – dpzz
    Oct 8, 2016 at 13:40
  • @dpzz According to JS code, lowest_address = "41d7FXjswpK1111111111111111111111111111111111111111111111111111111111111111111111111111112KhNi4" and highest_address = "4BKnGLZNZ5pjpXCZedGfVQjpXCZedGfVQjpXCZedGfVQjpXCZedGfVQjpXCZedGfVQjpXCZedGfVQjpXCZedGfVQVmzCh57" I have no idea if that is technically correct. Sep 20, 2017 at 0:54
  • Should have a ^ at the front since the address must start with a 4 i.e. .match(/^4...
    – nu everest
    Nov 6, 2017 at 2:15

This is better:


And payment ID:

  • 1
    This does not check for base58 instead of base64. Nov 15, 2016 at 10:21
  • The Payment ID is supposed to be hex, but can be 16 or 64 chars. The address regex is very loose and includes invalid characters plus a nonsense pipe character. Better see the selected answer as this one has big problems. Sep 20, 2017 at 1:04

There are some inappropriate regexes to the other answers here. At this time, only ferretinjapan's answer is correct, though it's a mouthful since it does not use ranges.

This regex will match (non-integrated) Monero addresses (subaddresses start with 8):


An integrated address has 106 or 136 characters and that the second character may be any base58 character (verification needed; this is a result of changing the netbyte prefix). Here's a regex to match just integrated (either 64-bit or full 256-bit) addresses:


To match any Monero address (standard, subaddress, integrated, or full 256-bit integrated):


With any of these regexes, if you are extracting addresses from larger bodies of text, you likely want to replace the ^ and $ anchors with \b word boundary markers.

  • Can you update to include subaddresses please?
    – sgp
    Nov 27, 2022 at 22:06
  • @sgp – Yes, done.
    – Adam Katz
    Nov 28, 2022 at 16:59

Long time ago someone pointed to me this regex to address


I belive its an more complete one, I am using it on PHP-Monero

  • 1
    This is not an accurate regex. The . (dot) matches any character. Sep 20, 2017 at 0:32

My Java Example:

public static boolean MoneroValid(String addr)
    String regex = "^4[0-9AB][1-9A-HJ-NP-Za-km-z]{93}$";
    return addr.matches(regex);
  • This doesn't catch integrated addresses, stagenet or testnet addresses.
    – jtgrassie
    Aug 14, 2019 at 1:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.