We present MAGICS, a mobile agent-based system for supporting business-to-consumer electronic commerce (ecommerce) or mobile commerce (m-commerce) applications. To use the system, consumers first provide their buying requirements to a proxy/agent server through a Web browser or a wireless application protocol (WAP) terminal. Having obtained the requirements, mobile agents are generated to carry out tasks for the consumers including getting offers from merchants, evaluating offers, and even completing purchases. In the case of mobile commerce, consumers can generate a mobile agent to conduct a search and evaluation in the digital marketspace before making a purchase in the physical marketplace. To make it possible to choose an offer that best satisfies the consumer's requirement(s), we present a mathematical model for evaluating multiple decision factors. To test the basic functions of the mobile agent-based Internet commerce system (MAGICS), we have built a prototype system. To minimize the average cost of a product (including the cost of sending agents), we have also developed an analytical model that can determine how many agents should be sent to compare prices. Four different price distributions and some real price information are analyzed based on the model. The analysis provides valuable insights into the design of mobile agent-based shopping applications for m-commerce, in particular, and for e-commerce, in general. Kong. His current research interests include modeling and cross-layer optimization of packet-switched third-generation wireless networks. Perry P. Y. Lam received the B.Sc. (Hons.) degree in information technology in 2002 and the M.Phil. degree in 2005, both from The Hong Kong Polytechnic University, Hung Hom, Kowloon, Hong Kong. Her current research interests include electronic commerce and Internet technologies. Henry C. B. Chan (M'95) received the B.A. and M.A. degrees from the