Cyclic codes are an interesting class of linear codes due to their efficient encoding and decoding algorithms. Bose–Chaudhuri–Hocquenghem (BCH) codes which form a significant subclass of cyclic codes are important in both theory and practice since they have good error-correcting capabilities and have been widely used in communication systems, storage devices, and so on. Quantum codes with good parameters can be also constructed from BCH codes. In this paper, we construct q-ary quantum codes of length $$\frac{q^{2m}-1}{\rho }$$ using constacyclic BCH codes with order $$\rho $$ and cyclic BCH codes, respectively, where $$\rho $$ divides $$q+1$$ , q is a prime power and m is a positive integer. By comparing the obtained quantum codes, we get that constacyclic BCH codes are a better resource in constructing quantum codes than cyclic BCH codes in general. Compared with the quantum codes available in Aly et al. (IEEE Trans Inf Theory 53(3): 1183–1188, 2007) and Zhang et al. (IEEE Access 4:36122, 2018), the quantum codes in our schemes have better parameters. In particular, we extend some known results in Kai et al. (Int J Quantum Inf 16(7):1850059, 2018), La Guardia (Phys Rev A 80(4):042331, 2009), Li et al. (Quantum Inf Comput 12:0021–0035, 2013), Lin (IEEE Trans Inf Theory 50(3):5551–5554, 2004), Tang et al. (IEICE Trans Fund E102-A(1):303–306, 2019), Wang and Zhu (Quantum Inf Process 14(3):881–889, 2015), Yuan et al. (Des Codes Cryptogr 85(1):179–190, 2017) to more general case.