A handheld barcode scanner with volume measuring function, comprising: a body comprising a working part and a holding part extended downward from a bottom of the working part; a processor arranged in the body and at least recording a volume measuring program and a decoding program; a first camera arranged on a front end of the working part and electrically connected with the processor; a second camera arranged on the front end of the working part and electrically connected with the processor; a barcode capturing unit arranged on the front end of the working part and electrically connected with the processor; and a first button arranged on one side of the holding part and electrically connected with the processor; wherein the processor is configured to execute the volume measuring program in accordance with multiple images respectively captured by the first camera and the second camera to obtain a volume of a target box and to execute the decoding program in accordance with an image captured by the barcode capturing unit to obtain content of a target barcode; characterized in that a second button is arranged on a top of the working part and electrically connected with the processor; wherein an execution target of the first button is the volume measuring program or the decoding program and the processor is triggered by the second button to switch the execution target of the first button, or an execution target of the second button is the volume measuring program or the decoding program, and the processor is triggered by the first button to switch the execution target of the second button; said handheld barcode scanner further comprising a buzzer electrically connected with the processor, wherein the processor is configured to control the buzzer to send a sound notification for two times when the processor is triggered to switch the execution target from the volume measuring program to the decoding program, and to send the sound notification for three times when the processor is triggered to switch the execution target from the decoding program to the volume measuring program. a body comprising a working part and a holding part extended downward from a bottom of the working part; a processor arranged in the body and at least recording a volume measuring program and a decoding program; a first camera arranged on a front end of the working part and electrically connected with the processor; a second camera arranged on the front end of the working part and electrically connected with the processor; a barcode capturing unit arranged on the front end of the working part and electrically connected with the processor; and a first button arranged on one side of the holding part and electrically connected with the processor; wherein the processor is configured to execute the volume measuring program in accordance with multiple images respectively captured by the first camera and the second camera to obtain a volume of a target box and to execute the decoding program in accordance with an image captured by the barcode capturing unit to obtain content of a target barcode; characterized in that a second button is arranged on a top of the working part and electrically connected with the processor; wherein an execution target of the first button is the volume measuring program or the decoding program and the processor is triggered by the second button to switch the execution target of the first button, or an execution target of the second button is the volume measuring program or the decoding program, and the processor is triggered by the first button to switch the execution target of the second button; said handheld barcode scanner further comprising a buzzer electrically connected with the processor, wherein the processor is configured to control the buzzer to send a sound notification for two times when the processor is triggered to switch the execution target from the volume measuring program to the decoding program, and to send the sound notification for three times when the processor is triggered to switch the execution target from the decoding program to the volume measuring program.