No real help (only guessing) without seeing a circuit diagram and the code.
I suppose that 12volt is coming from a mains transformer.
That 12volt can be 10-30% higher unloaded.
Peak is ~1.4x that voltage, minus two diode drops.
I assume you have calculated your voltage divider for that.
Common Arduinos have an A/D range from 0-1023, so I don't see why you are getting 1024.
Leo..