The spontaneous polarization (SP) and piezoelectric (PZ) constants of BxAl1-xN and BxGa1-xN (0 ≤ x ≤ 1) ternary alloys were calculated with the hexagonal structure as reference. The SP constants show moderate nonlinearity due to the volume deformation and the dipole moment difference between the hexagonal and wurtzite structures. The PZ constants exhibit significant bowing because of the large lattice difference between binary alloys. Furthermore, the PZ constants of BxAl1-xN and BxGa1-xN become zero at boron compositions of ∼87% and ∼74%, respectively, indicating non-piezoelectricity. The large range of SP and PZ constants of BxAl1-xN (BAlN) and BxGa1-xN (BGaN) can be beneficial for the compound semiconductor device development. For instance, zero heterointerface polarization ΔP can be formed for BAlN and BGaN based heterojunctions with proper B compositions, potentially eliminating the quantum-confined Stark effect for c-plane optical devices and thus removing the need of non-polar layers and substrates. Besides, large heterointerface polarization ΔP is available that is desirable for electronic devices.