This paper introduces a general and transferable deep learning (GTDL) framework for predicting phase formation in materials, addressing challenges like small datasets and the lack of knowledge transfer between models. The GTDL framework maps raw data to pseudo-images, uses convolutional neural networks for feature extraction and knowledge acquisition, and enables knowledge transfer by sharing feature extractors. Case studies on glass-forming ability (GFA) and high-entropy alloys (HEAs) demonstrate the framework's superior performance compared to existing models, achieving high accuracy in predicting GFA and classifying HEA phases. The framework's ability to leverage periodic table knowledge and transfer learning is particularly beneficial for tasks with limited data.