CV17/CV18 Extended Address Calculator
Description
Extended (long, 4-digit) DCC addressing splits the locomotive address across two CVs, CV17 and CV18, with an offset built into CV17 — it's not simply "the first two digits in CV17 and the last two in CV18," which is a common mistake. Working out the right byte values by hand means dividing by 256 and adding 192, easy to get wrong under pressure at the programming track.
Type an address to get its CV17/CV18 pair, or type a CV17/CV18 pair you've read off a decoder to get the address back — both fields update live from whichever one you change.
Don't forget CV29 bit 5 also has to be set to enable extended addressing in the first place — see this site's CV29 Calculator.
Sources
NMRA Standard S-9.2.2, "Configuration Variables For Digital Command Control, All Scales" (July 2012), defines CV17's valid range (192-231) and that CV18 holds the address's low byte, but states that range rather than spelling out the arithmetic in one place. The byte-splitting formula this calculator uses — CV17 = floor(address / 256) + 192, CV18 = address mod 256 — is the DCC industry's consistent implementation of that range, documented the same way by decoder manufacturers (for example Digitrax's own published 4-digit addressing formula), and verified here against a worked example (address 2345 → CV17=201, CV18=41).
Disclaimer: the NMRA's own two-byte encoding supports addresses up to 10239, but many DCC command stations only support or display 4-digit addresses (up to 9999) by product convention — check your system's own address range before programming a high address.

