By creating a browser bookmark with one of the following "URLs", you can get a random UIC wagon number / UIC number for tractive stock with a valid self-check digit any time for testing purposes:
// Option 1: Completely random 12-digit numbers with valid self-check digits:
javascript: alert(function(){var $=(Math.floor(9e10*Math.random())+1e10).toString();var z=($+function($){for(var r=0,e=0,n="",a=0;a<$.length;a++){var t=parseInt($.charAt(a));a%2==0?n+=""+2*t:n+=""+t}for(var a=0;a<n.length;a++)r+=parseInt(n.charAt(a));return(e=10*Math.ceil(r/10))-r}($)); return "Formatted: \""+z.replace(/(\d{2})(\d{2})(\d{4})(\d{3})(\d{1})/, %27$1 $2 $3 $4-$5%27)+"\" | Raw: \""+z+"\""}())
// Option 2: 12-digit numbers with valid tractive type codes, country codes and self-check digits.
// Type codes: https://en.wikipedia.org/wiki/UIC_identification_marking_for_tractive_stock#Type_code
// Country codes: https://en.wikipedia.org/wiki/List_of_UIC_country_codes
javascript: alert((function(){var $=[10,20,21,22,23,24,25,26,27,28,29,39,31,32,33,34,40,41,42,44,49,50,51,52,53,54,55,56,57,58,59,60,61,62,65,66,67,68,70,71,72,73,74,75,76,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99],r=(Math.floor(10*Math.random())+90).toString()+$[Math.floor(Math.random()*$.length)].toString()+(Math.floor(9e6*Math.random())+1e6).toString();return'Formatted: "'+(r+=function($){for(var r=0,o=0,t="",n=0;n<$.length;n++){var a=parseInt($.charAt(n));n%2==0?t+=""+2*a:t+=""+a}for(var n=0;n<t.length;n++)r+=parseInt(t.charAt(n));return(o=10*Math.ceil(r/10))-r}(r)).replace(/(\d{2})(\d{2})(\d{4})(\d{3})(\d)/,"$1 $2 $3 $4-$5")+%27" | Raw: "%27+r+%27"%27})())Clicking the bookmark will execute the JavaScript code and show your UIC number via the web browser's alert dialog. You can then copy it, or create a new one by clicking the bookmark again.
![]() |
|---|
| Chrome Bookmark |
![]() |
|---|
| UIC Number: 77 81 8312 076-6 |

