This paper considers price and modularity of competition between two firms with deterministic demand, in which demand is dependent on both the prices and the modularity levels determined by two firms. Bertrand competition and Stackelberg competition are formulated to derive the equilibrium solutions analytically. Because of the complexity, an intensive numerical study is conducted to investigate the impact of the sensitive parameters on equilibrium prices and modularity levels, as well as optimal profits of the two firms. An important and interesting finding is that optimal profits of the two firms under both types of competition are decreasing with the modularity cost when the price and modularity sensitivities are low, where both firms are worse-off due to decrease of the modularity levels; but they are increasing when the price and modularity sensitivities are high, where both firms are better-off at the expense of modular design. Our research reveals that Stackelberg game improves the modularity levels in most of the cases, though both firms perform better in Bertrand competition in these cases when jointly deciding the prices and modularity levels in the two firms.