An excited shout or cry, or the sound someone makes when they suddenly realize a mistake has happened.
From imitative origins (sound-based), possibly influenced by 'hoop' or similar exclamatory sounds; used since the 18th century to represent loud, excited vocalizations.
The word 'whoops' is pure onomatopoeia—it literally tries to spell out the sound of sudden excitement or surprise, which is why it feels so natural to shout it when something goes wrong!
Complete word intelligence in one call. Free tier — 50 lookups/day.