die Knarre
gun
A colloquial and often derogatory term for a firearm, especially a pistol or revolver.
Der Bankräuber bedrohte den Kassierer mit einer Knarre.
The bank robber threatened the cashier with a gun.

gun / ratchet / noisemaker
Loading your saved state.
gun
A colloquial and often derogatory term for a firearm, especially a pistol or revolver.
Der Bankräuber bedrohte den Kassierer mit einer Knarre.
The bank robber threatened the cashier with a gun.

The word 'Knarre' is onomatopoeic and derives from the verb 'knarren' (to creak), which describes a squeaking or rattling sound. This origin connects all the meanings: the sound of the tool and the instrument, as well as the harsh, unpleasant sound of the word for a weapon.
Die alte Holztür knarrte, als er sie öffnete.
The old wooden door creaked as he opened it.
Because 'Knarre' refers to very different things, context is crucial for understanding it. Words from the areas of crime ('bedrohen' — to threaten), trades or handiwork ('Schraube' — screw), or tradition ('Fasching' — Carnival) clearly show which meaning is intended.
Im Werkzeugkasten fand er die passende Knarre nicht.
He couldn't find the right ratchet in the toolbox.
As a term for a firearm, 'Knarre' is purely colloquial. The word has a negative and dangerous connotation and is often used in films or crime novels, but rarely in formal contexts such as police reports.
„Hände hoch, oder ich benutze die Knarre!“, schrie der Dieb.
'Hands up, or I'll use the gun!' shouted the thief.
When 'Knarre' means a tool, it is often combined with an 'Aufsatz' (attachment) or a 'Nuss' (socket) for different screw sizes. Typical actions are 'festziehen' (to tighten) or 'lösen' (to loosen) a screw.
Für diese Schraube brauchst du eine Knarre mit einem 13er-Aufsatz.
For this screw, you need a ratchet with a 13 mm socket.
pistol / gun
'Pistole' and 'Knarre' can both mean a firearm, especially a small weapon for one hand. 'Pistole' is the neutral and precise word. It is used in normal, factual, or official situations. 'Knarre' is colloquial and often derogatory. It sounds rougher and is more suitable for informal language, crime stories, or angry narration. The words can be confused because in everyday speech they sometimes refer to the same weapon. If you want to speak neutrally, 'Pistole' is the safe choice.

Im Film zieht der Täter plötzlich eine Knarre aus der Tasche.
In the film, the perpetrator suddenly pulls a gun out of his pocket.
Die Polizei fand eine Pistole im Auto des Verdächtigen.
The police found a pistol in the suspect's car.