Managing pedestrian movement in busy public environments is a complex challenge with critical implications for safety. The Smart Crowd Flow Optimizer introduces an integrated approach combining IoT-based real-time sensing, computer vision, and machine learning to effectively monitor and regulate pedestrian flow. By continuously analyzing data from sensors and surveillance cameras, the system identifies high-density regions, predicts crowd surges, and triggers dynamic alerts and routing strategies. Simulation studies show that congestion peaks can be reduced by up to 30%, resulting in smoother movement and improved safety outcomes. These findings highlight the system’s potential to enhance operational efficiency and support safer smart city environments