The present work studies the bubble formation in viscous liquids with the viscosity ranging from 5 to 400mPas by using a high-speed digital camera. The experiment was carried out in a flow-focusing device with square cross-section of 600×600μm. Results show that the viscous shear stress strongly influences the dynamics of bubble formation, including the shape and size of bubbles. The bubble size follows power-law relations with the gas flow rate, the flow rate and viscosity of the liquid phase respectively, indicating that bubbles formed in viscous fluids are controlled by a combination of squeezing mechanism and shearing mechanism. Therefore, the bubble size can be predicted by a power-law function depending on the flow rate ratio of gas and liquid phases φ representing the squeezing mechanism and capillary number Ca representing the shearing mechanism. In addition, the dynamics of bubble formation in viscous liquids in a flow-focusing device is also analyzed.